3.8. Onward

Java reflection preserves name and type information in the compiled class format. This is an evolution from many pointer-based programming languages, which make compile-time assumptions about name and type that might fail to be true at runtime. The availability of class metadata makes the dynamic linking of code more reliable.

Most of the metadata in the class file is also exposed programmatically, via the Reflection API. Reflection includes both discovery and invocation. Reflective invocation can be used to write generic services that adapt themselves to the types they discover at runtime. Dynamic proxies extend the notion of a generic service further by allowing service classes to be manufactured at runtime. While reflective access ...

Get Component Development for the Java™ Platform 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.