Possible Duplicate:
Java Generics
Hi,
Can anyone please explain the difference of the three and each proper usage?
Thanks, been googling but I’m still confused on how to use each.
czetsuya
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m assuming you’re talking about Generics. The ‘E’ and ‘T’ are placeholders and can be used interchangeably in class definitions. By convention ‘E’ is an Element and ‘T’ is a Type. The question mark is a placeholder for an unknown type. You often see things like this:
This implies that ‘x’ is a list of objects that are subclasses of MyObject, but we don’t know what they are exactly.
See: http://docs.oracle.com/javase/tutorial/java/generics/genTypes.html