how to print the name of a class in java code example Example: getting class name in java a.getClass().getName();