Home >Java >javaTutorial >How to Sort an ArrayList in Descending Order in Java?
Sorting an ArrayList in Descending Order
In Java, we can use Collections.sort() to sort a List or ArrayList in ascending order. However, for descending order, we need to perform an additional step.
Solution:
Example:
This will print the list in descending order:
The above is the detailed content of How to Sort an ArrayList in Descending Order in Java?. For more information, please follow other related articles on the PHP Chinese website!