Skip to content
Sharp

Reflection API · interview question

Why does the java.lang.reflect package in Java matter in this design?

Multiple choiceEasychapter-16-curatedpremiumreflection-apidynamic-class-loading
Choose one answer
Answer and explanation

Correct answer

A. Provides classes and interfaces for obtaining reflective information about classes and objects.

Why

The java.lang.reflect package provides the necessary classes and interfaces to inspect classes, interfaces, fields, and methods at runtime, enabling dynamic behavior in Java applications.

Test yourself on Reflection API

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

Start free test
All Reflection API questions →