Intellij IDEA中如何给main方法赋args
程序
package com.otherExample;
/**
1. Created by 谭雪娇 on 2017/3/29.
*/
public class args {
public static void main(String[] args){
System.out.println(args.length);
System.out.println(args[0]);
System.out.println(args[1]);
}
}
-
点击Edit configurations
-
配置Program arguments参数如图:传入多个参数使用换行符即可
-
运行结果:
转载于https://www.cnblogs.com/sinceForever/p/8454385.html
如侵权请联系我删除