1 Arrays.sort(points, new comparator()); 2 3 public static class comparator implements Comparator<Point> { 4 public int compare(Point p1, Point p2) { 5 return p1.x - p2.x; 6 }
2022-03-11 11:49:18
1 Arrays.sort(points, new comparator()); 2 3 public static class comparator implements Comparator<Point> { 4 public int compare(Point p1, Point p2) { 5 return p1.x - p2.x; 6 }