📌  相关文章
📜  按属性 java 对对象列表进行排序 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:24.933000             🧑  作者: Mango

代码示例1
ArrayList employees = getUnsortedEmployeeList();
             
Comparator compareById = (Employee o1, Employee o2) -> o1.getId().compareTo( o2.getId() );
 
Collections.sort(employees, compareById);
 
Collections.sort(employees, compareById.reversed());