I have a class defined like this:
public class Test {
static <T> List<Class<T>> filter(List<Class<T>> input) {
}
public static void main(String[] args) {
List<Class<? extends Throwable>> list =
new ArrayList<Class<? extends Throwable>>();
filter(list);
}
}
Calling method filterin maingives the following compilation error:
The method filter(List<Class<T>>) in the type Test is not applicable for the
arguments (List<Class<? extends Throwable>>)
I do not understand why it is <T>not attached to <? extends Throwable>. Are there any guru droids that can help me?
source
share