If I have two variables:
Object obj; String methodName = \"getName\";
Without knowing the class of obj, how can I call the met
obj
I do this like this:
try { YourClass yourClass = new YourClass(); Method method = YourClass.class.getMethod("yourMethodName", ParameterOfThisMethod.class); method.invoke(yourClass, parameter); } catch (Exception e) { e.printStackTrace(); }