1、代码
Collections.sort(stus,new Comparator<Student>() { @Override public int compare(Student o1, Student o2) { // TODO Auto-generated method stub if(o1.getName().compareTo(o2.getName()) >= 1){ //记得要写上>=,而不是大于 return 1; }else{ return -1; } } });