java - How can I implement generic method which has generic return type and generic parameter? -


i have generic interface service:

public interface service {     public <t> t callservice(t request); } 

i want modify callservice method such can accept generic parameter , return instance of different generic return type. how do that, either above declaration or modifying it?

a generic defined in same way have example there, have placeholder type name. if looking define have generic input parameter type , different generic return type can comma separate them.

public <t, r> r callservice(t request); 

Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -