Unmodifiable Lists and Immutable Lists in Java
, 3 min read
What you’ll take away
-
How a view and a snapshot explain the difference between an unmodifiable collection and an immutable one.
-
How the lists produced by these calls differ:
Collections.unmodifiableList()List.of()orList.copyOf()
