NullPointerException

The unchecked exception thrown when code uses a null reference as if it pointed to an object.

In more detail

NPE is the common abbreviation. It happens when calling a method on null, reading a field of null, or unboxing a null wrapper. Modern JVMs print a helpful message naming exactly which expression was null.

Related terms

Taught in

References

Certification courses