O'Reilly logo

Special Edition Using Java 2 Standard Edition by Geoff Friesen, Chuck Cavaness, Brian Keeton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Key Classes of the Reflection API

To accomplish the task of introspection, the Java API provides java.lang.Class and several classes in the java.lang.reflect package, including Constructor, Method, and Field. These classes are used to obtain information about their respective characteristics from an object. The following sections introduce you to the three key classes in the java.lang.reflect package. This discussion covers the major methods of each class (refer to the Java API documentation for a complete listing). Examples later in the chapter build on this introduction to the Reflection API to demonstrate how you use these classes in conjunction with java.lang.Class to support runtime discovery in your programs.

The Constructor Class

A Constructor ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required