public class MyClass { public static String getClassName() { String name = ???; // How can I return "MyClass"? return name; } }
I want to create a static method that returns the name of the class like this, but I don't know what to do.
MyClass.class.getName(); // Returns all class names up to package names.
MyClass.class.getSimpleName(); // Returns only the class name.
You can write whichever you want.
642 /usr/bin/google-chrome:symbol lookup error:/usr/bin/google-chrome: undefined symbol:gbm_bo_get_modifier
537 Uncaught (inpromise) Error on Electron: An object could not be cloned
546 Understanding How to Configure Google API Key
709 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
549 PHP ssh2_scp_send fails to send files as intended
© 2024 OneMinuteCode. All rights reserved.