so I have 2 methods, 1 with an argument the other without
command_hello(String sender);
command_hello();
I am trying to invoke the method using just their name:
command_hello
I can do this by using the following for the method with no arguments:
getClass().getMethod("command_hello").invoke(this);
Works! Great! But the moment I try
getClass().getMethod(cmds.get(cmd)).invoke(this, "Bob");
I get an java.lang.NoSuchMethodException.
---------
Object invoke(Object obj, Object... args), where args are the args of the method I'm invoking and obj is where the method is invoked from.
---------
Any suggestions? I tried casting "Bob" to an Object with no luck...