What is the difference between List<Apple> and List<? extends Fruit>?

Dive into the depths of Java with our quiz based on "Thinking in Java, Fourth Edition" by Bruce Eckel. Test your knowledge, solidify concepts, and prepare for certification with challenging questions and insightful feedback.

List specifies a List that can only contain Apple objects, while List<? extends Fruit> specifies a List that can contain any type of Fruit (including Apple). Option A is incorrect because List can only contain Apple objects, not any type of Fruit. Option C is incorrect because List and List<? extends Fruit> have different specifications. Option D is incorrect because there is a clear distinction between List and List<? extends Fruit> in terms of which types of objects they can contain.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy