Examveda

In Java generics, what is the purpose of the `? extends T` wildcard?

A. It represents an unknown type

B. It allows any type to be used as a generic

C. It restricts the generic type to be a subclass or the same as `T`

D. It specifies a return type

Answer: Option C


This Question Belongs to Java Program >> Generics In Java

Join The Discussion

Related Questions on Generics in Java