What Is Reflection?

The Java Reflection API gives you a way to examine objects at runtime as well as dynamic ally update fields and invoke methods. Although Reflection is useful in a few places in day-to-day application programming, most of the common uses of Reflection are in the area of middleware tools. For example, the TOPLink database-mapping tool uses Reflection to copy database values into Java objects and vice-versa. Reflection isn't hard to use, and it's extremely powerful.

Get Special Edition Using Java™ 2 Enterprise Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.