Skip to content
Sharp

Reflection API · interview question

Why is Method.invoke() considered less type-safe compared to direct method calls?

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

Correct answer

C. It bypasses compile-time type checks.

Why

Method.invoke() bypasses compile-time type checks by resolving method calls at runtime, which can introduce errors that would normally be caught during compilation.

Test yourself on Reflection API

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

Start free test
All Reflection API questions →