码迷,mamicode.com
首页 > 其他好文 > 详细

命令行参数

时间:2014-07-31 16:15:16      阅读:149      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   java   os   io   for   ar   

 1 package first;
 2 
 3 public class TestArgs {
 4 
 5     public static void main(String[] args) {
 6         if (args.length != 2) {
 7             System.out.println("Error!");
 8             System.out.println("Length=" + args.length + "they are:");
 9             for (String s : args)
10                 System.out.println(s);
11         } else {
12             for (String s : args)
13                 System.out.println(s);
14         }
15 
16     }
17 
18 }

java   classname  args1 args2       //输入参数

bubuko.com,布布扣

命令行参数,布布扣,bubuko.com

命令行参数

标签:style   blog   color   java   os   io   for   ar   

原文地址:http://www.cnblogs.com/thrive/p/3880564.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!