Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.ArrayList;
- import java.util.Collections;
- public class ArraySort {
- public static void main(String[] args) {
- ArrayList<int[]> arrayListOfPoints = new ArrayList<>();
- arrayListOfPoints.add(new int[] { 6, 6 });
- arrayListOfPoints.add(new int[] { 3, 2 });
- arrayListOfPoints.add(new int[] { 1, 2 });
- Collections.sort(arrayListOfPoints, (a, b) -> Integer.compare(a[0], b[0]));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement