public class testa {
public static void main(String[] args) {
List<String> list=new ArrayList<>();
Collections.addAll(list,"1","2","3");
Collections.shuffle(list);
Collections.sort(list);
Collections.addAll(list,"a","b","c");
Collections.shuffle(list);
Collections.sort(list);
List<testb> car=new ArrayList<>();
car.add(new testb("莹",10));
car.add(new testb("囧",14));
car.add(new testb("花",8));
Collections.sort(car);
}
}
@Override
public int compareTo(testb o) {
return this.getCount() - o.getCount();
}