简单集合排序
public static List getIntegerList(){
List integerList = new ArrayList...integerList.add(43);
integerList.add(8);
return integerList;
}
/**
* Integer集合排序...System.out.println("排序后:"+integerList);
}
输出:
排序前:[23, 15, 35, 68, 43, 8]
排序后:[8, 15, 23, 35, 43, 68]
根据对象集合某个字段排序...public static List getUserList(){
List userList = new ArrayList();...score=88),
User(name=小詹, age=14, city=广州, score=77), User(name=小龙, age=16, city=深圳, score=55)]
根据对象集合多个字段排序