0Pricing
Java Academy · Lesson

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

  1. List & Set Overview
  2. Iterators & Enhanced for
  3. Collections Utilities
← Back to Java Academy