SetE Factory Method Examples
suggest changeSet<Integer> immutableEmptySet = Set.of();- Initializes an empty, immutable
Set<Integer>. Set<Integer> immutableSet = Set.of(1, 2, 3, 4, 5);- Initializes an immutable
Set<Integer>with five initial elements. Set<Integer> mutableSet = new HashSet<>(immutableSet);- Initializes a mutable
Set<Integer>from an immutableSet<Integer>.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents