jeudi 21 février 2019

Can I call a method in java without knowing its class?

I want to call a method dynamically where the method name is input and the class in which the method is declared is not known, for example :

String methodName = "myMethod";

I want to call the method called "myMethod". is it possible ? I know reflection can work if I have the class name also, but here it is not available





Aucun commentaire:

Enregistrer un commentaire