I have a simple for loop which prints the content of an integer array. It keeps throwing java.lang.ArrayIndexOutOfBoundsException exception. I have been scratching my head for couple of hours not knowing what is that I am doing wrong
public class ReverseArray {
public static void main(String[] args) {
int[] nums = {100,90,80,70,60,50,40,30,20,10};
for(int i = 10; i >= 0; i--){
System.out.print(nums[i] + " ");
}
}
}