0

Suppose I have strings.

String j = "objectName";
String i = "methodName";

How can I call a method:

objectName.methodName();

When I only have the strings for the names?

FaureHu
  • 792
  • 8
  • 18
  • Yes, you are right. Reflections are the answer and this question can be marked as a duplicate. Thank you. – FaureHu Jan 29 '15 at 00:05
  • As a side note, when calling `invoke()`, if you have no parameters, just pass in null as one of them. – EDToaster Jan 29 '15 at 00:09

0 Answers0