get name of class java code example
Example 1: java class name to string
String className = n.getClass().getName();
String name = className.substring(className.lastIndexOf('$')+1,className.length()-4);
System.out.println(name);
Example 2: getting class name in java
a.getClass().getName();
Example 3: java get class name of object
myObject.getClass().getName()