posted 16 years ago
List<? super Animals> dlist
declares a reference variable that can hold a List of any type that is Animal OR a superclass to Animal. So your statement is correct that this could be a List<Animal>, List<Species>, or a List<Object>. When it comes to adding, since the generic type of list will hold Animal or higher, the compiler knows that it will hold anything Animal or a subclass of Animal.
You may add Dog, you may add Animal, you may not add Species, you may not add Object. The only things that you can add to a <? super ClassName> are ClassName or subclass of ClassName.
------------------------
Bob
SCJP - 86% - June 11, 2009