java獲取當前方法的名稱

String clazz = this.getClass().getName(); 獲取當前類的 類名   String method = Thread.currentThread() .getStackTrace()[1].getMethodName(); 獲取當前方法   返回一個數組 Thread.currentThread() .getStackTrace()這個方法保存當前線程的棧快照
相關文章
相關標籤/搜索