Collections class provides static methods that operate on or return
Collection objects. It is part of the
import java.util.Collections; Collections.method();
Below is a list of methods provided by the
- Returns the maximum member of a List based on natural ordering or based on a Comparator.
- Returns the minimum member of a List based on natural ordering or based on a Comparator.
- Reverses the current ordering of a List.
- Randomizes the order of elements in a List.
- Sorts a List based on natural ordering or based on a Comparator.
- Swaps the position of two elements in a List.
Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.
Learn Java on Codecademy
Computer ScienceLooking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
Includes 6 Courses
With Professional Certification