java Programming Glossary: countlegs
What's the purpose behind wildcards and how are they different from generics? http://stackoverflow.com/questions/2922811/whats-the-purpose-behind-wildcards-and-how-are-they-different-from-generics a parameter for a method. Imagine you have a method int countLegs List extends Animal animals int retVal 0 for Animal cur animals.. animals int retVal 0 for Animal cur animals retVal cur.countLegs return retVal With this signature you can do this List Dog dogs.. With this signature you can do this List Dog dogs ... countLegs dogs List Cat cats ... countLegs cats List Animal zoo ... countLegs..
|