Sometimes we want to sort a List based on some property. Suppose we have a List of UserModel and we want to sort List by firstName then we can do that easily by using Collections.sort() and Comparator ...
###问题 我读过使用Comparator对常规类的ArrayList进行排序的示例,但是它们大多数使用comparedTo ...
> 原文:[https://www . geesforgeks . org/如何在 java 中按降序对数组列表进行排序/](https://www.geeksforgeeks.org/how-to-sort-an-arraylist-in ...