Witam,
poniższy kod nie kompiluje się na Java 8 a kompiluje na 7, dlaczego?? Tak jakby nie dokońca doprecyzowany parametr generyczny powodował zgubienie typu w parametrze zwracanym
public class Main {
public static void main(String[] args) {
Class c = Integer.class;
String s = hello(c).get(0); //Type mismatch: cannot convert from Object to String
}
public static List<String> hello(Class<? extends Number> n) {
return null;
}
}