Thank guys. I thought so. I could not find anything in Java language or Standard Java classes. I guess one could write a custom method:
method_name, Class ClassName)
and put in the top level class (may be customized Object class) of your application. So that every class will inherit it. This method will make use of super to go one level up and check if that class is the same as ClassName. If it is then it will execute method_name. Else it will go one level up and repeat the same. If Object class is reached then throw an exception.
What do you guys think?
In FoxPro, if I could have some function name in a string, I could say:
and that will execute that function. Is there some thing like that in Java. Also how do extract the class name of context class at run time?