How can I write a generic method parameter at my interface method?
public <T extends Mail> T getById(HttpServletResponse response, <ID extends Object> ID);
This line gives me error:
<ID extends Object> ID
Any ideas?
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.
You’re close.
Note that
extends Objectis not a meaningful bound for a wildcard. And declaringIDto be a wildcard on a single method is rarely helpful without any bounds.