Multiple choice

Which of the following exceptions is shown by the method remove (int index) in the List interface in java collection framework?

  1. UnsupportedOperationException

  2. IndexOutOfBoundsException

  3. NullPointerException

  4. All of the above

  5. Only (1) and (2)

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

Yes, both the exceptions are thrown by the remove method in the List interface.