O'Reilly logo

Component Development for the Java™ Platform by Stuart Dabbs Halloway

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

3.2. Reflection

The Java Reflection API presents a Java interface to the metadata contained in the binary class format. You can use reflection to dynamically discover the characteristics of a Java class: its base class, superinterfaces, method signatures, and field types. Better yet, you can use reflection to dynamically instantiate objects, invoke methods, and mutate fields. These features make it possible to write generic object services that do not rely on, or even have advance knowledge of, the specific classes they will be working on.

Reflection makes it straightforward to serialize an instance to a stream, generate relational database tables that correspond to a class's fields, or create a user interface that can manipulate instances of ...

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