java - Problem with Method.invoke -
i have method return list of objects , want call invoke method of class method. problem invoke method returns object
, not list<object>
.
the code here:
class<? extends anobject> anobject = myobject.getclass(); method mymethod = myobject.getmethod("getlistobject"); object objject = method.invoke(myobject); // want return list
how can solve it?
class<? extends anobject> anobject = myobject.getclass(); method mymethod = myobject.getmethod("getlistobject"); list object = (list)mymethod.invoke(anobject);
Comments
Post a Comment