Reflection Flashcards
1
Q
What is Reflection?
A
Reflection is a way for Java to inspect itself at runtime. It breaks encapsulation.
2
Q
What does Reflection (java.lang.reflect) contain?
A
It contains the methods for runtime inspection of objects:
- Class of the object
- Fields
- Methods
- Constructors.
3
Q
When is Reflection used?
A
Reflection is usually used when building frameworks