Can anyone tell the difference between
Arrays.sort(points, (a, b) -> Integer.compare(a[1], b[1]));
Arrays.sort(points, (a, b) ->{ return a[1] - b[1]; });
Can anyone tell the difference between
Arrays.sort(points, (a, b) -> Integer.compare(a[1], b[1]));
Arrays.sort(points, (a, b) ->{ return a[1] - b[1]; });
These are (essentially) functionally the same, as per documentation
Integer.compare(x, y) returns "the value 0 if x == y; a value less than 0 if x < y; and a value greater than 0 if x > y"