Answers for "java return the name of the class"

3

java get classname

//Just the name of the class
myObject.getClass().getSimpleName();

//The name of the class with the package name
myObject.getClass().getName();
Posted by: Guest on March-23-2021
0

return class name java

Try using this this.getClass().getCanonicalName() or this.getClass().getSimpleName().
 If it's an anonymous class, use this.getClass().getSuperclass().getName()
Posted by: Guest on January-30-2022

Code answers related to "java return the name of the class"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language