Tagged articles
2 articles
Page 1 of 1
FunTester
FunTester
Apr 12, 2020 · Fundamentals

Why Groovy’s null behaves differently from Java’s null – A deep dive

This article compares Java’s null, which throws NullPointerException on member access, with Groovy’s NullObject that safely handles method calls, explains the underlying implementation, demonstrates practical code examples, and shows how to customize NullObject behavior via metaClass extensions.

GroovyJavaNullObject
0 likes · 4 min read
Why Groovy’s null behaves differently from Java’s null – A deep dive
Java Captain
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
Avoiding NullPointerException with the Null Object Pattern and Optional in Java