Multiple choice

Which of the following exceptions is thrown in Java when an application attempts to use null where an object is required?

  1. Arithmetic exception

  2. Null pointer exception

  3. ArrayIndexOutOfBounds exception

  4. None of these

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

This exception is thrown when an application attempts to use null where an object is required.