I have a custom type Position(x,y,z),now I create a ArrayList, i want to sort this array ordered by the value of z, from small to b
Position(x,y,z)
ArrayList
You need to implement your Comparator, which will compare the value of the z attribute.
Comparator
z