Wednesday, August 28, 2013

how to go from String to method

how to go from String to method

I hope the title was understandable .
I have 4 functions :
public void seta1(...);
public void seta2(...);
public void seta3(...);
public void seta4(...);
Now the user gives me a String with the methods partial name ( say String
input = "a1"). Is there a way ( without using case option) to activate the
correct method ?
something like : (set+input)();

No comments:

Post a Comment