Пример #1
0
 @Override
 public int compare(People o1, People o2) {
   // TODO Auto-generated method stub
   return o2.getAge() - o1.getAge();
 }
Пример #2
0
 @Override
 public int compare(People o1, People o2) {
   // 如果年龄相等,想按姓名排序的话,自己补充
   return o1.getAge() - o2.getAge();
 }