打印出当前方法的名称

String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
System.out.println(methodName);

猜你喜欢

转载自kanpiaoxue.iteye.com/blog/2406063