ArrayIndexOutOfBoundsException – attempt to access an out of range array index. int x [ ] = new int [ 5 ]; int y = -2; // 1 x [ y ] = 2; // 2 x [ 2 ] = 2; // 3 x [ 5 ] = 5; // 4 System.out.println( x[0] ); // 5 a) Statement 1 and 2 are false b) Statement 2 and 3 are false c) Statement 2 and 4 are false d) Statement 2 and 5 are false

Showing Answers 1 - 3 of 3 Answers

bihag

  • Mar 17th, 2007
 

c

because u develope array x[0],x[1],x[2],x[3],x[4]

y=-2

x[y] ==> give exception
x[5] ==> give exception

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions