|
Relates :
|
|
|
Relates :
|
|
|
Relates :
|
This program should continue to not compile:
import java.util.*;
class Test {
private static <T> T method(Collection<? super T> arg) {
return null;
}
private static void test5(Collection<?> arg) {
Class<? extends String> c = method(arg).getClass();
}
}
This program does not compile:
import java.util.*;
class Test {
private static <T> T method(Collection<? super T> arg) {
return null;
}
private static void test4(Collection<? super String> arg) {
Class<? extends String> c = method(arg).getClass();
}
private static void test6(Collection<String> arg) {
Class<? extends String> c = method(arg).getClass();
}
}
|