So, I want to sort an array of points using the built-in sort method defined by the coordinate, for example x. How can i do this? Here is a sample code:
Point A[] = new Point[10];
Arrays.sort(A, x-coordinate);
Is there a built-in comparator for x-coordinates in Point Class? If not, how can I create it and use it. An example would be great.
Thank.
source
share