|
|
|
|||
|
Examining ClassesIf you are writing a class browser, you need a way to get information about classes at runtime. For example, you might want to display the names of the class fields, methods, and constructors. Or, you might want to show which interfaces are implemented by a class. To get this information you need to get theClass
For each class, the
Java Runtime Environment (JRE)
maintains an immutable
Retrieving Class Objects
First things first.
Before you can find out anything about a class, you must first retrieve its
corresponding
Getting the Class Name
It's easy to find out the name of a Discovering Class Modifiers
This section shows you the methods you need to call to find out what modifiers a particular class has. Finding Superclasses
In this section you'll learn how to retrieve all of the
Identifying the Interfaces Implemented by a Class
If you want to find out what interfaces a class implements, then check out this section. Examining Interfaces
In this section you'll learn how to tell if
a
Identifying Class Fields
This section shows you how to
discover what fields belong to a class,
and how to find out more about these fields
by accessing
Discovering Class Constructors
This section, which introduces the
Obtaining Method Information
To find out about a class's methods, you need to retrieve
the corresponding
| |||
|