javase:如何在方法体内得到当前类名称以及方法名,javase体内
分享于 点击 8318 次 点评:39
javase:如何在方法体内得到当前类名称以及方法名,javase体内
//获取当前类全名
String clazz = Thread.currentThread() .getStackTrace()[1].getClassName();
// 获得当前方法名
String method = Thread.currentThread() .getStackTrace()[1].getMethodName();
System.out.println("class name: " + clazz + " Method Name " + method);
相关文章
- 暂无相关文章
用户点评