Skip to content
Sharp

Reflection API · interview question

Why do teams use Reflection in Java frameworks in production code?

Multiple choiceMediumchapter-16-curatedpremiumreflection-apibreaking-encapsulation
Choose one answer
Answer and explanation

Correct answer

B. To inspect classes and objects at runtime

Why

Reflection allows Java frameworks to inspect and manipulate classes and objects at runtime, enabling dynamic behavior such as dependency injection, aspect-oriented programming, and dynamic method invocation.

Test yourself on Reflection API

A free test with instant, explained results. No account needed.

Start free test
All Reflection API questions →