I'm confused by this syntax because at first it appears as though the function should return <E>
but then I see void
. What is the purpose of the <E>
prior to the void
?
Also, I'm familiar with bounding and generics, but I've never actually seen something bounded this way. What does this syntax mean Comparator<? super E>
?
Here is a sample function:
private <E> void sort(E[] array, Comparator<? super E> cmp) {
qsort(array, 0, array.length - 1, cmp);
}