获取当前类名: 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中获取当前运行的类名,方法名,行数 ...