-1
我正在使用NetBeans 7.1.2。我的錯誤是:在NetBeans 7.1.2中獲取命令行參數
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
at javaapplication1.JavaApplication1.main(JavaApplication1.java:17)
Java Result: 1
我的程序是:
package javaapplication1;
/**
*
* @author Administrator
*/
public class JavaApplication1 {
/**
* @param args the command line arguments
*/
public static void main(String[] ar) {
int a=Integer.parseInt(ar[1]);
System.out.println(a);
// TODO: Code application logic here
}
}