java.lang.reflect
Reflectionis the ability of a program to analyze itself. Thejava.lang.reflectpackage provides
the ability to obtain information about the fields, constructors, methods, and modifiers of a
class. Among other reasons, you need this information to build software tools that enable you
to work with Java Beans components. The tools use reflection to determine dynamically the
characteristics of a component. Reflection was introduced in Chapter 12 and is also examined
in Chapter 27.
java.lang.reflectdefines several classes, includingMethod,Field, andConstructor. It also
defines several interfaces, includingAnnotatedElement,Member, andType. In addition, the
java.lang.reflectpackage includes theArrayclass that enables you to create and access arrays
dynamically.
436 Part II: The Java Library