arrays.sort int 2d code example Example: java sort 2d array Arrays.sort(myArr, (a, b) -> a[0] - b[0]);