int[][] a = {{7,0}, {4,4}, {7,1}, {5,0}, {6,1}, {5,2}};
Arrays.sort(a,(o1,o2)->o1[0] == o2[0] ? o1[1] - o2[1] : o2[0] - o1[0]);
List<int[]> list = new LinkedList<>();
for(int[] p:a){
list.add(p[1],p);
}
System.out.println(list);
System.out.println(list.toArray(new int[a.length][2]));
转载请注明原文地址:https://blackberry.8miu.com/read-35718.html