|
|
|
|||
|
Getting the Class NameEvery class in the Java programming language has a name. When you declare a class, the name immediately follows theclass keyword. In the following class declaration,
the class name is Point:
At runtime, you can determine the name of a Class object by invoking the
getName method. The String returned by getName is the fully-qualified
name of the class.
The following program gets the class name of an object.
First, it retrieves
the corresponding
The sample program prints the following line:
java.awt.Button | |||
|