获取java类和方法名

String clazz = this.getClass().getName();
String method = Thread.currentThread() .getStackTrace()[1].getMethodName();
System.out.println(clazz);
System.out.println(method);

posted @ 2016-03-30 15:39  testway  阅读(279)  评论(0编辑  收藏  举报