I assume this is Java... If that is the case, this returns the name of the method you are currently in.
String methodName = new Exception().getStackTrace()[0].getMethodName()
Be careful though, don't put this in a method, because then that will return the name of that method. You could also use this:
public String getMethodName() {
return new Exception().getStackTrace()[1].getMethodName();
}
This observes the second element of the stack trace, returning the correct method name.
UPDATE:
Though the first does what it takes, this is nicer: doesn't involve creating a new object at least:
Thread.currentThread.getStackTrace()[1].getMethodName();
Warning I have to mention that all this however has an adverse impact on performance...