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
I use this (just an example I cut and past but same idea) for descending sort:
@Override public int compare(Member m1, Member m2) { double fit1 = m1.getFitness() ; double fit2 = m2.getFitness() ; if (fit2>fit1) return 1; else if (fit2