如何从该类中的静态方法获取类的名称.例如
public class MyClass {
public static String getClassName() {
String name = ????; // what goes here so the string "MyClass" is returned
return name;
}
}
Run Code Online (Sandbox Code Playgroud)
为了把它放在上下文中,我实际上想要在异常中将类名作为消息的一部分返回.