If I have a ArrayList of Columns and Columns have the field disparityRating which is an int how do I sort the arraylist of column by the value of the disparityRating field?
I have tried implementing the comparable interface on my column class but when I do and change the compare to parameter to Column like this:
@Override
public int compareTo(Column o) {
return 0;
}
It comes up with an error saying method does not override method from its superclass
My main class has an arraylist of columns
Collection<Column> columns = new ArrayList<>();
and so I want to be able to sort them by using
Collections.sort(columns);