Wednesday, July 27, 2016

Getting the name of the current executing method

String methodName = new Object(){}.getClass().getEnclosingMethod().getName();
(OR)
String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
 

 
 
 
 
 

No comments:

Post a Comment