我正在使用 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