Collections
StevenSwiniarski474 total contributions
Published Jul 18, 2022
Contribute to Docs
The Collections
class provides static methods that operate on or return Collection
objects. It is part of the java.util
package.
import java.util.Collections;
Collections.method();
Below is a list of methods provided by the Collections
class:
Collections
- .max()
- Returns the maximum member of a List based on natural ordering or based on a Comparator.
- .min()
- Returns the minimum member of a List based on natural ordering or based on a Comparator.
- .reverse()
- Reverses the current ordering of a List.
- .shuffle()
- Randomizes the order of elements in a List.
- .sort()
- Sorts a List based on natural ordering or based on a Comparator.
- .swap()
- Swaps the position of two elements in a List.
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.