[Chapter 1] 1.2 The java.lang.reflect Package

#

| Chapter 1 Introduction |

## 1.2 The java.lang.reflect Package

The `java.lang.reflect` package is new in Java 1.1. It contains classes and interfaces that support the new Reflection API. Reflection refers to the ability of a class to reflect upon itself, or look inside of itself, to see what it can do. The new JavaBeans API depends upon the Reflection API, as does the object-serialization functionality in Java 1.1.

The Reflection API makes it possible to discover the variables, methods, and constructors of any class and manipulate those members as appropriate. For example, you can use a `Method` object to call a particular method in an object, even if your code was not compiled with any information about the class that contains that method. The `java.lang.reflect` package also defines an `Array` class that can be used to manipulate arbitrary arrays.

All of the classes in `java.lang.reflect` work in conjunction with the `Class` class in the `java.lang` package.

See Chapter 13, The java.lang.reflect Package, for complete reference material on all of the classes in the `java.lang.reflect` package.

The java.lang Package |  | The java.io Package