dimanche 10 septembre 2017

How to get Class Object of an ArrayList type?

I am trying to access a method through reflection, and the getMethod() function requires a class for the parameter type. The parameter is a Class object, and I'm not sure how to get this from an ArrayList<String> type. Here is my current code, where I would want to change String.class:

Method m = o.getClass().getMethod(method, String.class);





Aucun commentaire:

Enregistrer un commentaire