String classname = new Exception().getStackTrace()[1].getClassName(); //获取调用者的类名 String method_name = new Exception().getStackTrace()[1].getMethodName(); //获取调用者的方法名
java 获取调用者
最新推荐文章于 2024-07-01 03:09:44 发布
String classname = new Exception().getStackTrace()[1].getClassName(); //获取调用者的类名 String method_name = new Exception().getStackTrace()[1].getMethodName(); //获取调用者的方法名