In Java generics, what is List <? super String> means?
3 answers
No (i.e. yes, you missed something :-). <? super String>
<? super String>
- any class that is a superclass of String
(including String
itself). (In this case, the only other suitable class is Object
.)
What you described will be <? extends String>
<? extends String>
(which is not very useful in this particular case, since String
is final
, so it cannot have any subclasses).
+20