Skip to content
Sharp

Reflection API · interview question

How would you explain a major reason for the performance overhead when using reflection in an interview?

Multiple choiceMediumchapter-16-curatedpremiumreflection-apimethod-invoke
Choose one answer
Answer and explanation

Correct answer

A. Runtime type checking and method lookup

Why

Reflection incurs performance overhead because the JVM must perform runtime type checking and lookup for the method to be invoked, which is more resource-intensive compared to direct method calls.

Test yourself on Reflection API

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

Start free test
All Reflection API questions →