【发布时间】:2011-03-29 07:38:01
【问题描述】:
我正在使用 Netbeans 传递一个命令行参数,但我得到一个 ArrayIndexOutOfBoundsException。
我的代码是:
public class CmdLineArgumentPassing
{
public static void main(String args[])
{
System.out.println("Count : " + args.length);
System.out.println("i : "+args[0]);
}
}
输出是:
Count : 0
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
【问题讨论】:
标签: java netbeans command-line-arguments netbeans-6.9