ArrayIndexOutOfBoundsException - Core Java

Q.  If you are inserting any value in the wrong index as shown below,

1. int a[]=new int[5];
2. a[10]=50;

it would result in ______.

- Published on 20 Jul 15

a. NullPointerException
b. ArrayIndexOutOfBoundsException
c. ArithmeticException
d. NumberFormatException

ANSWER: ArrayIndexOutOfBoundsException

Post your comment / Share knowledge

Enter the code shown above:
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)