Thread.currentThread().getStackTrace()[1].getClassName();
Thread.currentThread().getStackTrace()[1].getMethodName();
本文介绍了如何使用 Java 的 Thread 类获取当前线程的调用堆栈信息,包括获取调用者的类名和方法名。
Thread.currentThread().getStackTrace()[1].getClassName();
Thread.currentThread().getStackTrace()[1].getMethodName();

被折叠的 条评论
为什么被折叠?