Intellij IDEA中如何给main方法赋args

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]);
    }
}
  1. 点击Edit configurations
    在这里插入图片描述

  2. 配置Program arguments参数如图:传入多个参数使用换行符即可
    在这里插入图片描述

  3. 运行结果:
    在这里插入图片描述

转载于https://www.cnblogs.com/sinceForever/p/8454385.html
如侵权请联系我删除

猜你喜欢

转载自blog.csdn.net/qq_45895520/article/details/117885998