Sorry, I don't work with Java since a long time. I have a class which sort int type, and I am trying to do this, but this does not compile:
MySort.sort(vectorOfInt, new Comparator() {
@Override
public int compare(Object o1, Object o2) {
return (int)o1 - (int)o2;
}
});
I would like to sort a vector of int using this method using the comparator to sort in ascending order.
public static void sort(T[] a, Comparator c) {
sort(a, 0, a.length, c);
}