sort a 2 d array by the first colum code example Example: sort 2d array based on one column java Arrays.sort(array, Comparator.comparingDouble(o -> o[0]));