📅  最后修改于: 2022-03-11 14:52:12.999000             🧑  作者: Mango
public class AgeComparatorDesc implements Comparator {
@Override
public int compare(Student o1, Student o2) {
if (o1.age > o2.age) {
return -1;
} else if (o1.age < o2.age) {
return 1;
}
return 0;
}
}