I'm making an array that outputs a user's input in reverse order. My program works however I keep getting this message, "Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1 at Reverse.main(Reverse.java:26)"
I'm looking at line 26 which is, "System.out.println(number[x]);" but I don't see what's the matter with this. Why is this occurring?
for(int x= number.length -1; x<SIZE; x--)
System.out.println(number[x]);
}
}
x >= 0;x--