To a collection defined with ? super T
as the type parameter, you can add objects of type T
and it's descendants: ? super Cat
means "Cat
and it's superclasses, up to Object
". In your case, List<? super Cat>
may be a List<Cat>
, and you can't add, for instance, Animals
, to a collection of Cats
, since Animal
is-not-a Cat
(the reverse is true).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…