Generics : List<? extends Animal> is same as List<Animal>?
- by peakit
Hi,
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!