标签:oid star ima stat static get 流程 命令行参数 循环

1 public class GetSum {
2 public static void main(String[] args) {
3 int S = 0;
4 for(String i:args)
5 S += Integer.parseInt(i);
6 System.out.print("Sum = " + S);
7 }
8 }

关键点:
调用Integer静态方法parseInt(String)将字符串解析为int。
标签:oid star ima stat static get 流程 命令行参数 循环
原文地址:http://www.cnblogs.com/lzq666/p/7630329.html