獲取當前類名: this.getClass .getSimpleName 也可以 獲取當前方法名: ...
2019-08-24 11:29 0 752 推薦指數:
Description Below I present you two different ways to get the current Class: Using Thread ...
獲取class名: this.getClass().getName(); 或者 Thread.currentThread().getStackTrace()[1].getClassName(); 獲取方法名: Thread.currentThread().getStackTrace ...
().ReflectedType.Name; // 類名 獲取當前方法的名稱空間、類名和方法名稱 ...
java獲取調用當前方法的方法名和行數String className = Thread.currentThread().getStackTrace()[2].getClassName();//調用的類名 String methodName = Thread.currentThread ...
JAVA中獲取當前運行的類名,方法名,行數 ...