Sort an array of 2-d array by the first dimension and then the second one

前端 未结 0 1828
天涯浪人
天涯浪人 2021-01-29 10:23
int[][] arrs = {{1,100},{11,22},{1,11},{2,12}};
Arrays.sort(arrs, (a, b)->(a[0]-b[0]));

Above array has been sorted as

{1, 100}
{1, 11         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题