Which exception is thrown when an object reference is null?

  1. NullReferenceException
  2. NullPointerException
  3. NoSuchObjectException
  4. ReferenceError
Correct answer NullPointerException

Explanation

Accessing methods or members on a null object reference throws NullPointerException.

Update: Admin added a tag on this question

Topics

By Admin · · 28 views