Advertisement
Guest User

Untitled

a guest
Jul 16th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1. import java.util.ArrayList;
  2. import java.util.Collections;
  3.  
  4. public class ArraySort {
  5.     public static void main(String[] args) {
  6.         ArrayList<int[]> arrayListOfPoints = new ArrayList<>();
  7.         arrayListOfPoints.add(new int[] { 6, 6 });
  8.         arrayListOfPoints.add(new int[] { 3, 2 });
  9.         arrayListOfPoints.add(new int[] { 1, 2 });
  10.         Collections.sort(arrayListOfPoints, (a, b) -> Integer.compare(a[0], b[0]));
  11.  
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement