-1

What is the difference between NullPointerException and NullReferenceException?

1

3 Answers 3

11

There is no NullReferenceException in Java. It's a .NET class, which is the equivalent of Java's NullPointerException.

Sign up to request clarification or add additional context in comments.

Comments

3

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'.

Comments

3

Java using NullPointerException instead of NullReferenceException. So there is no NullReferenceException in Java.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.