but it is written in kathy book that
[i][b]First, the <? extends Animal> means that you can take any subtype of Animal;
however, that subtype can be EITHER a subclass of a class (abstract or concrete)
OR a type that implements the interface after the
word extends. In other words,
the keyword extends in the context of a wildcard represents BOTH subclasses and
interface implementations. There is no <? implements Serializable> syntax. If
you want to declare a method that takes anything that is of a type that implements
Serializable, you'd still use extends like this:
// odd, but correct
// to use "extends"
This looks strange since you would never say this in a class declaration because
Serializable is an interface, not a class. But that's the syntax, so burn it in!
One more time—there is only ONE wildcard keyword that represents both
interface implementations and subclasses[/b][/i]
then how can compiler check that is a class...as Extends represent both class and interface