The following example shows how to get a reference to class object and accessing its name.
Class provides the following APIs,
public String getSimpleName()
- Returns the simple name of class as given in the source code.
For anonymous class it returns empty string.
public String getName()
- Returns the name of the class along with package name.