2 compareTo method overriden in the same class definition, how could I force to use the second?
- by jayjaypg22
I want to sort a list List<Blabla> donnees by a criterion on one of its field. My problem is that compareTo is already overriden for this Class. So I've got something like :
Blabla {
public int compareTo(Object other) {
...
}
public int compareTo(Blabla other) {
...
}
}
In a business layer class I call :
Business {
method (){
Collections.sort(List<Blabla > donnees);
}
}
But this call N°1 compareTo method with object parameter. How could I sort my list with the N°2 method?