Ace Java 2025: Rock Your 'Thinking in Java' Challenge!

Image Description

Question: 1 / 510

What restriction does using <? super T> in a generic class or method impose?

The class or method cannot accept arguments of type T

Objects of T or its superclasses can be added to a collection

When using a generic class or method with the <? super T> restriction, objects of type T or any of its superclasses can be added to a collection. This means that objects of more specific types cannot be added, but it allows for a wider range of objects to be accepted. Options A, C, and D are incorrect because they imply more limitations on the type of objects that can be used, while option B provides the most accurate description of the restriction imposed by <? super T>.

Get further explanation with Examzify DeepDiveBeta

The class or method cannot return objects of general types

Only objects of type Object can be used with the class or method

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy