Sail E0 Webinar
Question

What is use of wildcards?


Options:
A .  It is used in cases when type being operated upon is not known.
B .  It is used to make code more readable.
C .  It is used to access members of super class.
D .  It is used for type argument of generic method
Answer: Option A

The wildcard can be used in a variety of situations: as the type of a parameter, field, or 

local variable; sometimes as a return type (though it is better programming practice to 

be more specific). The  wildcard  is  never  used  as  a  type argument  for a generic 

method invocation, a generic class instance creation, or a supertype.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers