整型数组按照字典序排序
输入
...
0,1,2,3,5,7,8,1001,10
9
...
输出
...
0,1,10,1001,2,3,5,7,8
Collections.sort(list, new Comparator<Integer>() {
@Override
public int compare(Integer o1, Integer o2) {
String A = o1 + "";
String B = o2 + "";
return A.compareTo(B);
}
});
标签:...,String,整型,数组,排序,字典
From: https://www.cnblogs.com/aclq/p/17797157.html