Possible Duplicate:
How do I invoke a Java method when given the method name as a string?
I have 10 methods named: m1
, m2
, m3
,...
like this:
public void m1(){
..
}
How do I invoke them with string in a 'for' loop?
I want to do this:
for (int i=1;i<11;i++){
invoke('m'+i);
}