程序:

package com.otherExample;

/**
 * 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

 Intellij IDEA中如何给main方法赋args

 

2:配置Program arguments参数如图:传入多个参数使用换行符即可

 Intellij IDEA中如何给main方法赋args

 

3:运行结果:

 

 

 Intellij IDEA中如何给main方法赋args

 

相关文章:

  • 2021-12-08
  • 2021-11-29
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
  • 2021-10-09
  • 2021-05-16
  • 2022-01-09
猜你喜欢
  • 2022-12-23
  • 2021-04-17
  • 2022-01-22
  • 2021-04-04
  • 2021-11-05
  • 2022-02-08
  • 2021-11-19
相关资源
相似解决方案