public class QS {
public static <T extends Comparable<? super T>> T[] quickSort(T[]array) {
return doSort(array, 0, array.length - 1);
}
//some other methods.................
public static void main(String [] args){
QS qs = new QS();
int [] nums = {4,7,23,1,2,45,23,11};
qs.quickSort(nums);//gives error
}
}
I am getting an error in which it won't allow me to do a quicksort on an int array.
the error message is <T>quickSort(T[]) in QS cannot be applied to (int[])
update: if i changed my int [] to a String [], then it works no problem..