codepoetics

codepoetics

Share this post

codepoetics
codepoetics
Unchained Nullity

Unchained Nullity

Dominic Fox's avatar
Dominic Fox
Aug 29, 2024
∙ Paid
1

Share this post

codepoetics
codepoetics
Unchained Nullity
Share

Nullity in Java can be a subtle business. If you call get(key) on a plain HashMap with a key that is not in the map, you will get null back. If you call put(key, null) on the same HashMap, then get(key), you will also get null back. In the former case, containsKey(key) will return false; in the latter (after insertion), true: the null you inserted is ge…

Keep reading with a 7-day free trial

Subscribe to codepoetics to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Dominic Fox
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share