Originally posted by Anurag Blore:
Answer: CDG
why B is incorrect//As Ber extends Animal
why E is incorrect as anything which extends Animal should be able to assigned to an Animal.
Hi Anurag,
"list<Bear>" is assignable to only a "list<Bear>" and nothing else not its subtype, not its supertype, so it cannot be assigned to list<Animal>.
And about "list<? extends Animal>" is assignable to "list<Animal>"- i think you are right!
"list<? extends Animal>" means anything which is a subtype of animal, including animal can be assigned(Bear,
Cow,D,Animal).