List<Person> personList = TestClass.getPersonList(20);
personList.sort(new Comparator<Person>() {
@Override
public int compare(Person o1, Person o2) {
int num0 = o1.score - o2.score;
return num0 == 0 ? o1.age - o2.age : num0;
}
});
可以自由按照排序规则进行排序
1865

被折叠的 条评论
为什么被折叠?



