View Single Post
  #4 (permalink)  
Old 07-30-2007, 11:40 AM
Swamipsn Swamipsn is offline
Member
 
Join Date: Jul 2007
Posts: 72
Swamipsn is on a distinguished road
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]
Reply With Quote