java - Pass Class as parameter and return same class object -
i want pass class parameter , return same class parameter. parameter can of class. want comman method in need pass object of particular class , give me same object return. know java - generics or java collection possible don't know how?
code:
public class_object_as_paramter(parent) webcall(class obj parameter(parent)) throws jsonsyntaxexception, ioexception, xmlpullparserexception { gsonbuilder gsonbuilder = new gsonbuilder(); gson gson = gsonbuilder.create(); parent = (collection<?>) gson.fromjson(soaplcalls .getuserwisesalescontracts(gsonexample.this, "55000024"), parentsalescontract.class (also has pass same class here); return parent; }
create generic method this:
<t> t method(t t) { ... t tt = ... return tt; }
Comments
Post a Comment