I have an ArrayList
with type length 2 int[]
. ArrayList<int[]>
What I want to do is sort the ArrayList
by increasing order of the second element of int[1]
.
Is there any built-in method to do this?
Asked
Active
Viewed 34 times
0
-
`arrayList.sort((p1, p2) -> p1[1] < p2[1]);` – flakes Oct 28 '16 at 19:26
-
Or `Comparator.comparingInt(p -> p[1])`. – Tunaki Oct 28 '16 at 19:29
-
I don't understand what p and [1] stand for – KCoder Oct 28 '16 at 19:32