Hi Rajiv,
There are atleast 2 ways u could do this :
1. It is sure that the no. of possible methods are limited. Because u have to first declare them before calling. So, as in the previous answer, u have to declare a switch-case construct, andresolve method names through that. This would be a static binding, i.e changes in no. of methods would demand changes in the cases.
2. For dynamism.
a. Assume that there's this file callOne.java which receives var value.
b. And, methodCollection.java has all the methods declared in it.
c. Now create a method resolve(methodName) inside callOne.java, which would create an object of "methodCollection" and using java.lang.reflect find out the proper method
e.g
Method []methodObjs= methodCollectionObject.getClass().getMethods();
Loop through the methodObjs, find the method and execute it.
Use java.lang.reflect.Method and java.lang.Class
Nise