Java代码之输出参数和(强制类型转换)

时间:2021-02-26 19:35:08

说明(因为Java中java Application的参数都是默认的字符型的数据,所以需要强制类型转换这一步骤)

设计思想:

向系统里输入若干个参数,计算出参数个数,利用for语句计算出参数的和。(程序中需要进行强制类型转换,因为java Application中的数据是字符型的,不能进行运算),最后输出参数的和

流程图:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAhYAAAIBCAIAAACa9mGnAAAgAElEQVR4nO3dLWwrzdnw8YUHGkZFgYaG0aCQR41U4koFKbkVVdUoJe9x2/tuzQ4M9MUCAyOVBFSaqCjwwMCAAYaGhoH7gvXH+mttb3Z3duf6/8DTnMR2dqNb839mdzxOxuPxv//9799+++3XX3/9xz/+8fe//300Gn3//v379+//D1BmNBr985///O233/71r3/9+uuv379//9vf/vaXv/zll19++eWXX/785z//6U9/+uMf//iHP/zh97///f8B6iV/BQCglOSvf/1rCgDA+UgIAKAkEgIAKImEAABKIiEAgJJICACgJBICACiJhAAASiIhAICSSAgAoCQSAgAoiYQAAEoiIQCAkkgIAKAkEgIAKImEAABKIiEAgJJICACgJBICACiJhAAASiIhAICSSAgAoCQSAgAoiYQAAEoiIQCAkkgIAKAkEgIAKImEAABKIiEAgJJICACgJBICACiJhAAASiIhAICSSAgAoCQSAgAoiYQAAEoiIQCAkkgIAKAkEgIAKImEAABKIiEAgJJICACgJBICACiJhAAASiIhAICSSAgAoCQSAgAoiYQAAEoiIQCAkkgIAKAk1Qn5z3/+E/oQAGjX6YGIhABASJ0eiEgIAITU6YGIhABASJ0eiEgIAITU6YGIhABASJ0eiEgIAITU6YGIhABASJ0eiEgIAITU6YGIhABASJ0eiEgIAITU6YGIhABASJ0eiEgIAITU6YGIhABASJ0eiEgIAITU6YGIhABASJ0eiKJKyH/OF/qQAWjX6YErqoQAAJpEQgAAJWlPSJIkSZKEPgqcajabTSaTHyG8vr6GPnugdUgICemM19fXfr8/Go2CJOTm5mY4HH5+fob+MwAtQkJISDfMZrN+vz+fzwMew8PDw3g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6v/1TZiFAlUgImlNbQlazDOvyE47VTGNnFtLATXUSAg1ICJpTX0JWl6xy84vljGPBWeuy7239oCYkBBqQEDSnxtvpi2mGEbc3Ic5mN0oWN0nE1D8RISHQgISgOXUlxItd9SC/Kiu7ve7s+kZ77g0jG28kqQEJgQYkBM3h3elAZEgImkNCgMiQEDSHhACRISFoDgkBIkNC0BwSAkSGhLWN++EAAAF+SURBVKA5JASIDAlBc0gIEBkSguaQECAyJATNmc1mFxcXoY+iISQEGpAQNKrX683n89BHUbuPj49+vx/6KIDakRA06u7u7unpKfRR1G4ymYxGo9BHAdSOhKBR8/m83+9Pp9PQB1KjbAqiYbIFkBA07f39vd/vPzw8vL29hT6WKn1+fr69vY3H48Fg8P7+HvpwgCaQEAQwn8/H4/H19fX2x9F22bdv366vrx8eHj4/P0P/gYGGkBAAQEkkBABQEgkBAJREQgAAJZEQAEBJJAQAUBIJAQCUREIAACWREABASSQEAFASCQEAlERCAAAlkRAAQEkkBABQEgkBAJREQgAAJZEQAEBJJAQAUBIJAQCUREIAACWREABASSQEAFASCQEAlERCAAAlkRAAQEkkBABQEgkBAJREQgAAJZEQAEBJJAQAUBIJAQCUREIAACWREABASSQEAFASCQEAlERCAAAlkRAAQEkkBABQEgkBAJREQgAAJZEQAEBJJAQAUNL/B8FRgy1FjCkFAAAAAElFTkSuQmCC" alt="" />

程序源代码:

package demo;

public class CommandParameter {

    /**
* @param args
*/
public static void main(String[] args) { // TODO Auto-generated method stub
System.out.println("参数个数:"+ args.length);
int m=0;
for(String arg : args)
{ m=m+Integer.parseInt(arg); }
System.out.println(m);
} }