stuck on something that should be pretty simple.
I have the class TreeSort:
public class TreeSort {
public static <E extends Comparable<? super E>> void sort(E[] nums) {
//Sorting
}
}
And a simple Tester class with a main method for testing:
public class Tester {
public static void main(String[] args) throws TreeStructureException {
int[] nums = { 11, 2, 8, 30, 12, 21, 6, 4, 3, 18 };
TreeSort.sort(nums); // The method sort(E[]) in the type TreeSort is not
// applicable for the arguments (int[])
}
}
Why do I get this error? Thanks all
int[]isn't anInteger[].