码迷,mamicode.com
首页 > 编程语言 > 详细

java的命令行参数到底怎么用,请给截图和实际的例子

时间:2018-09-22 16:55:01      阅读:169      评论:0      收藏:0      [点我收藏+]

标签:content   use   图片   chapter   ati   sys   target   command   详情   

8.2 命令行参数示例(实验)
public class Test {
public static void main(String[] args){
        if(args.length==0){
               System.out.println("you don‘t set command line parameters!");
        }else{
               for (int i=0; i
                     System.out.println("args[" + i + "] is: " + args[i]);
            }
       }
}
}



when use eclipse, don‘t "run as application",directly use "run configurations/run", then add in aguments in program arguments.(当运行eclipse,不要"run as application",而直接用"run configurations/run",然后加上参数在,program arguments.)

技术分享图片

技术分享图片

更多详情请见:http://www.mark-to-win.com/index.html?content=JavaBeginner/javaUrl.html&chapter=JavaBeginner/JavaBeginner1_web.html#CommandLinePar

java的命令行参数到底怎么用,请给截图和实际的例子

标签:content   use   图片   chapter   ati   sys   target   command   详情   

原文地址:https://www.cnblogs.com/mark-to-win/p/9690218.html

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