把写代码过程中比较好的一些代码段收藏起来,如下的资料是关于Java中得到当前方法的名称(字符串)的代码。
String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();