September 2019
Intermediate to advanced
816 pages
18h 47m
English
Creating unmodifiable/immutable collections in Java can easily be accomplished by means of the Collections.unmodifiableFoo() method (for example, unmodifiableList()) and, starting with JDK 9, via the set of of() methods from List, Set, Map, and other interfaces.
Furthermore, we will use these methods in a bunch of examples to obtain unmodifiable/immutable collections. The main goal is to determine whether each defined collection is unmodifiable or immutable.
OK. In the case of primitives, it is pretty simple. For example, we can create an ...