O'Reilly logo

Java™ Phrasebook by Timothy Fisher

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

16. Dynamic Programming Through Reflection

Reflection is a mechanism for discovering data about a program at runtime. Reflection in Java enables you to discover information about fields, methods, and constructors of classes. You can also operate on the fields and methods that you discover. Reflection enables what is commonly referred to as dynamic programming in Java. Reflection in Java is accomplished using the Java Reflection API. This API consists of classes in the java.lang and the java.lang.reflect packages.

The things that you can do with the Java Reflection API include the following:

  • Determine the class of an object

  • Get information about a class’s modifiers, fields, methods, constructors, and superclasses

  • Find out what constants and method ...

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