how get class name code example
Example 1: how get class name
String className = this.getClass().getSimpleName();
Example 2: 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 3: getting class name in java
a.getClass().getName();