工作中的记录 不是秋刀鱼的秋 2019-11-13 133 阅读1分钟 2019/11/13 集合的排序 Collections.sort(students, new Comparator<Student>() { @Override public int compare(Student o1, Student o2) { return o1.getAge()-o2.getAge(); } }); 结果按student正序排列