java运行出错
public class Primes {
public static void main(String[] args) {
int N = Integer.parseInt(args[0]);
boolean [] a = new boolean[N];
for(int i = 2; i < N ; i++){
a[i] = true;
}
for(int i = 2; i < N ; i++){
if(a[i] != false){
for(int j = i; j * i < N; j++){
a[i * j] = false;
}
}
}
for(int i = 2; i < N ; i++){
if(i > N - 100){
if(a [i]){
System.out.println(" " + i);
}
}
}
System.out.println("辅导费 ");
}
}
这是错误信息:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at a.Primes.main(Primes.java:6)
[解决办法]