I am new to Generics and trying to understand why this code compiles:
public Collection<Class<Subclass>> testFunction() {
return Collections.singleton(Subclass.class);
}
And this code doesn't:
public Collection<Class<? extends SuperClass>> testFunction() {
return Collections.singleton(Subclass.class);
}
My SubClass looks like this:
public class Subclass extends SuperClass{
}