Say A is an interface. What is the difference between
public <T extends A> void foo(T t) { ... }
and
public void foo(A a) { ...}
?
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.
Not much.
On the other hand, consider this method:
And caller code:
It wouldn’t be possible (above wouldn’t compile, as compiler would force you to declare
resulttype asA) had you declared method as