//获取当前类全名
String clazz = Thread.currentThread() .getStackTrace()[1].getClassName();
// 获得当前方法名
String method = Thread.currentThread() .getStackTrace()[1].getMethodName();
System.out.println("class name: " + clazz + " Method Name " + method);
javase:如何在方法体内得到当前类名称以及方法名
最新推荐文章于 2024-04-15 17:50:57 发布