Use the following problems to test your Java Reflection API programming prowess. I strongly encourage you to give each problem a try before you turn to the solutions and download the example programs:
- Inspecting packages: Write several examples for inspecting Java packages (for example, names, a list of classes, and so on).
- Inspecting classes and superclasses: Write several examples for inspecting classes and superclasses (for example, get Class via the class name, modifiers, implemented interfaces, constructors, methods, and fields).
- Instantiating via a reflected constructor: Write a program that creates instances via reflection.
- Getting the annotation of a receiver type: Write a program that gets the annotation on a receiver type.
- Getting synthetic and bridge constructs: Write a program that gets synthetic and bridge constructs via reflection.
- Checking the variable...