|
Simple reason
public class ex1
{
private static int[] numbers=new int[4];
public static void main( String args[] )
{
for (int i = 0;i<=3;i++) {
numbers[i]=1;
}
}
}
Problem is you are trying to access numbers[4] obviously it has number[0]
to numbers[3], not numbers[4]
|