The following code helps you to identify what is the method that is being executed in JAVA at runtime:
StackTraceElement[] ste = Thread.currentThread().getStackTrace();
String strMethodName = ste[1].getMethodName(); // Get this method name
If you specify 2 in place of 1 in the second statement, it will give you the method that has called this method and so on in the stack.
StackTraceElement[] ste = Thread.currentThread().getStackTrace();
String strMethodName = ste[1].getMethodName(); // Get this method name
If you specify 2 in place of 1 in the second statement, it will give you the method that has called this method and so on in the stack.