Reflection Flashcards

1
Q

What is Reflection?

A

Reflection is a way for Java to inspect itself at runtime. It breaks encapsulation.

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

What does Reflection (java.lang.reflect) contain?

A

It contains the methods for runtime inspection of objects:

  1. Class of the object
  2. Fields
  3. Methods
  4. Constructors.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

When is Reflection used?

A

Reflection is usually used when building frameworks

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