liveBook · Manning

NullPointerException

Also called null pointer exception

NullPointerException is a Java runtime exception raised when code attempts to use a null reference where an object is required.

How 2 Manning books explain it

100 Java Mistakes and How to Avoid Them

NullPointerException is the Java runtime exception raised when an operation dereferences or otherwise improperly uses a null reference.

How it is used
Frames null-related Java failures and prevention across APIs, varargs, initialization, and collections.
How deep it goes
Defines nullability concerns and develops focused failure mechanisms, stopping at prevention rules and tool guidance.
Examples
Uses null varargs casts, static field ordering, logger initialization, and Set.of contains(null) migration cases.
What you can do after
Diagnose/debug with it by tracing nullable flows, initialization order, varargs binding, and collection null policies.

Read how 100 Java Mistakes and How to Avoid Them explains NullPointerException →

Kotlin in Action, 2E

NullPointerException is a runtime exception raised when code dereferences a null reference where a non-null object is required.

How it is used
Uses nullability checks to prevent runtime dereference failures in JVM backends and Android applications.
How deep it goes
Explains nullable types and operators with a compact example, but defers deeper runtime and interoperability edge cases.
Examples
Demonstrates nullable and non-nullable String access and cites reduced Google Home crashes after Kotlin adoption.
What you can do after
Apply nullable types and Kotlin operators to prevent or explicitly handle possible null dereferences.

Read how Kotlin in Action, 2E explains NullPointerException →

Also covered in

What to know first

Related concepts

Questions about NullPointerException

What is NullPointerException?

NullPointerException is a Java runtime exception raised when code attempts to use a null reference where an object is required.

Which Manning books explain NullPointerException?

100 Java Mistakes and How to Avoid Them and Kotlin in Action, 2E.

What should I know before learning NullPointerException?

Manning books that teach NullPointerException usually introduce exception and Java first.

What is the difference between NullPointerException and NumberFormatException?

NullPointerException is a Java runtime exception raised when code attempts to use a null reference where an object is required. NumberFormatException is a Java runtime exception thrown when text cannot be converted to the required numeric format.

What is NullPointerException a kind of?

NullPointerException is a kind of exception. An exception is a runtime signal or value representing an abnormal condition that interrupts ordinary program flow and can be handled or propagated.

What is NullPointerException also called?

NullPointerException is also called null pointer exception.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.