Reflections API Flashcards

1
Q

What is Reflection API?

A

Reflection is an API which is used to examine or modify the behavior of methods, classes, interfaces at runtime.
Reflection gives us information about the class to which an object belongs and also the methods of that class which can be executed by using the object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What can you do with the Reflections API that you can’t do in normal code?

A

You can retrieve the definition of a protected or final member, remove the protection and manipulate it as if it had been declared mutable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

List some classes and methods of the Reflections API

A

getMethod()
getDeclaredMethod()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly