dimanche 2 août 2015

Java calling method from generic class

Is something like that possible.

List<?> myList = getMyList();
class cls = class.forname("com.lab.myClass");
cls = myList.get(0);
cls.getValue();

Create an Instance with the fully-qualified name of a class and use their declared Methods?





Aucun commentaire:

Enregistrer un commentaire