What’s the purpose behind wildcards and how are they different from generics?
The wildcards do not make a lot of sense when you declare local variables, however they are really important when you declare a parameter for a method. Imagine you have a method: int countLegs ( List< ? extends Animal > animals ) { int retVal = 0; for ( Animal cur : animals ) { … Read more