Generics : List<? extends Animal> is same as List<Animal>?
问题 I am just trying to understand the extends keyword in Java Generics. List<? extends Animal> means we can stuff any object in the List which IS A Animal then won\'t the following also mean the same thing: List<Animal> Can someone help me know the difference between the above two? To me extends just sound redundant here. Thanks! 回答1: List<Dog> is a subtype of List<? extends Animal> , but not a subtype of List<Animal> . Why is List<Dog> not a subtype of List<Animal> ? Consider the following