Java's JDK provides unmodifiable collections but lacks a proper ImmutableList type in the type system. The post explains why adding one is fundamentally difficult: ImmutableList and List cannot extend each other because immutability is a positive guarantee, not merely the absence of mutation. A proper hierarchy would require an

10m read timeFrom nipafx.dev
Post cover image
Table of contents
▚ What's An Immutable Collection?▚ Just Add Immutable Collections, Already!▚ Immutability Is A Feature▚ Can Unmodifiable And Immutable Collections Be Retrofitted?▚ Reflection

Sort: