Use Null Object in Java when a default no-op collaborator makes absence explicit and safer than scattered null checks.
The Null Object pattern replaces null with an object that implements the expected interface and supplies default behavior. In Java, that can remove repetitive null checks and simplify collaboration code when the absence of a dependency should behave like “do nothing” rather than “throw.”
That does not make Null Object universally better than null, Optional, or explicit failure handling. If absence is business-significant, a silent no-op object can hide mistakes rather than clarify them. The pattern is strongest when the default behavior is honest, stable, and easy to reason about in reviews.
The pages in this section cover implementation, the effect on control-flow complexity, and real Java use cases. Use them to decide whether a Null Object improves clarity or merely turns an important missing-state signal into invisible behavior.