Am I missing something? It gives an error on sort method (doesn't identify the comparator method) but if I use Integer type array then this error goes away. Can't we do this comparison with primitive type of arrays?
public class Test {
public static void main(String[] args) {
int a[]={21,58,89,45,73,24};
Arrays.sort(a,new Comparator<Integer>(){
@Override
public int compare(Integer o1, Integer o2) {
if(o1%10>o2%10) return -1;
return 1;
}
});