samedi 28 janvier 2017

I want to search for a method inside a java class. I have method name as String and name of the class in which I am looking into [duplicate]

This question already has an answer here:

class A {
    method x() {
    }

    method y() {
    }
}

class B {
    A a = new A();
    String methodName = "x";
    // I want to execute this statement **a.x();**
}

I know the method name and I want to call the method automatically.





Aucun commentaire:

Enregistrer un commentaire