Java SE Reflection API
To pass this test you will need to understand the facilities that reflection provides to:
- Find methods and fields using java.lang.Class,
- Invoke methods,
- Access fields,
- Instantiate objects, and finally,
- Use dynamic proxies.
| Released | Beta | Frozen | ||
|---|---|---|---|---|
The Class class 6 questionsObtain the java.lang.Class instance corresponding to a class using the following techniques:
Display ability to correctly use the following methods to identify the class and identify its relationship with other Class instances:
|
10 | 44 | 55 | |
Member Access and Method Invocation 6 questionsShow how to use the Class methods for acquiring references to fields and methods:
Display correct usage of following Method methods, including exception handling:
Demonstrate correct usage of following Field methods, including exception handling:
Identify the role played by the SecurityManager when accessing non-public fields and methods. Write code using the Modifier.is*() methods, to check accessibility prior to potentially causing an IllegalAccessException to be thrown. Finally, display safe usage of setAccessible() to circumvent access checks. |
21 | 75 | 30 | |
Object Creation 6 questionsShow how to use the Class reflection methods for accessing constructors:
Demonstrate correct usage of Class.newInstance(), including exception handling, show understanding that this method implicitly calls the default constructor of the target Class instance. Display correct usage of the following Constructor methods, including exception handling:
Write code using the Modifier.is*() methods, to check accessibility prior to potentially causing an IllegalAccessException to be thrown, additionally display use of the setAccessible() method to circumvent access checking. Finally, display full and proper usage of the java.reflect.Array class to create (and initialise the contents of) an array of a given Class instance, using the Array.newInstance() method. Multi dimensional arrays are not covered. |
12 | 4 | 39 | |
Dynamic Proxy 2 questionsThis category specifically covers the java.lang.reflect.Proxy class and java.lang.reflect.InvocationHandler interface. Display the knowledge required to:
Demonstrate that:
Explain correct usage of the InvocationHandler interface:
Provide understanding of a typical Proxy behaviour in either of the two following conditions:
|
2 | 25 | 16 |
Exam information
- 30 minutes
- 20 questions (333)
- 80% required
- +3 √
- - 12 points
- 15 day delay
- status: released



