Multiple choice

Which of the following exceptions occurs, if one is trying to access an element of array with an index that is larger than the range?

  1. ArrayIndexOutOfBoundsException

  2. ArrayIndexOutOfBoundsExceptions

  3. ArrayIndexOutOfBoundException

  4. ArrayOutOfBoundsException

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The ArrayIndexOutOfBoundsException occurs if one is trying to access an element of array with an index that is larger than the range. For example: int Num[]={0,2,3}; Num[5]=0; /This statement throws the exception/