Java Captain
Jan 5, 2019 · Fundamentals
Avoiding NullPointerException with the Null Object Pattern and Optional in Java
This article explains the "null‑check disaster" in Java, introduces the Null Object design pattern with full code examples, presents the NR Null Object IntelliJ plugin for automatic generation, and demonstrates how Java 8 Optional and Kotlin safe‑call operators can provide cleaner, null‑safe alternatives.
DesignPatternJavaNullObject
0 likes · 9 min read