默认按照首个汉字的拼音首字母进行升序排列
public static void main(String[] args) {
List<Map<String, Object>> list=new ArrayList<>();
Map<String, Object> map= new HashMap<>();
map.put("province", "陕西");
Map<String, Object> map1=new HashMap<>();
map1.put("province", "山西");
Map<String, Object> map2=new HashMap<>();
map2.put("province", "重庆");
Map<String, Object> map3=new HashMap<>();
map3.put("province", "湖北");
list.add(map);
list.add(map1);
list.add(map2);
list.add(map3);
System.out.println("排序前:"+list);
listSort(list);
System.out.println("排序后:"+list);
}
public static void listSort(List<Map<String, Object>> resultList) {
Coll