Nkumawat Nkumawat - 1 year ago 117
Java Question

NullPointerException and NullReferenceException

What is the difference between NullPointerException and NullReferenceException?

Answer Source

NullPointerException - The Java exception thrown when an application attempts to use null in a case where an object is required.

NullReferenceException - The exception that is thrown when there is an attempt to reference (or use) a null or uninitialized object.

There is no 'NullReferenceException' in Java. Java has an equivalent class 'NullPointerException'.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download