Can I get method name dynamically?
I want a class get calling method name dynamically .
e.g. The class is named DynGetMethod,it has a method getMethodName().
If a class Test with a method test1() call it,class DynGetMethod can get method name "test1".
Code maybe like this:
/**Start**/
class Test {
DynGetMethod dyn = new DynGetMethod();
void test1(){
System.out.println(dyn.getMethodName());
}
}
/**End**/
It will print "test1".
How can I implement the method getMethodName()?
Thanks !

