print current class name java code example Example: getting class name in java a.getClass().getName();