Collections Utilities
Use helpful utilities from java.util.Collections: sort, reverse, shuffle, min/max, frequency, addAll, and unmodifiable views.
Overview
The Collections helper class provides small tools that save time: sort, reverse, shuffle, min/max, frequency, addAll, and unmodifiableList. These are in java.util.Collections.
In-place operations
In-place methods (sort, reverse, shuffle) modify the given List. For Sets, copy to a List before sorting. For readability, print before/after when you mutate.
All lessons in this course
- List & Set Overview
- Iterators & Enhanced for
- Collections Utilities