I am trying to make a program that executes a particular method when the class name and method name are passed as String parameter to the caller. Consider the code below. I
What to do now???
You can now call the method on your carObj like this:
carObj
Method method = carObj.getClass().getMethod(methodName); method.invoke(carObj);
See also:
Method.invoke