1、定义时只能用extends,因为super是逻辑不通的
2、使用时可以super,可以extends
3、?
通配符表达,但要满足
泛型定义条件
--------------sample---------------
class A<T extends CharSequence> {
A(T t) {}
}
--> OK
class A<T super CharSequence> {
A(T t) {}
}
--> FAIL
String s = "s";
Intger i = 1;
A<String> a = new A<>(s); --> OK
A<? extends String> a = new A<>(s); -->OK
A<?> a = new A<>(s); --> OK
A<?> a = new A<>(i); --> FAIL
A<? super String> a = new A<>(s); -->OK