java获取当前方法的名称

String clazz = this.getClass().getName(); 获取当前类的 类名   String method = Thread.currentThread() .getStackTrace()[1].getMethodName(); 获取当前方法   返回一个数组 Thread.currentThread() .getStackTrace()这个方法保存当前线程的栈快照
相关文章
相关标签/搜索