Want to execute a function in runtime, which function name is got it from runtime:
public static void callClassname() throws Exception
{
String[] getExecute =getInputdata.getEligibleColoumn();
for(int i=0 ; i < getExecute.length ; i++)
{
getExecute[i] = getExecute[i].concat("()");String test = "classname." .concat(getExecute[i]);
System.out.println("Test Passed:" + test);
}
}
in the above code test will give the result classname.functionname()
. I want to execute it or call it. Could you please help me how to do it, or any other better way? plz suggest.