Which exception is thrown when accessing an array with invalid index?

  1. ArrayIndexOutOfBoundsException
  2. NullPointerException
  3. IOException
  4. IndexMismatchException
Correct answer ArrayIndexOutOfBoundsException

Explanation

Accessing an array with an invalid index throws ArrayIndexOutOfBoundsException.

Update: Admin added a tag on this question

Topics

By Admin · · 30 views