Skip to content
Sharp

Java Annotations · interview question

What role does the Method.invoke() function play in Java reflection?

Multiple choiceMediumchapter-16-curatedpremiumjava-annotationscustom-annotations
Choose one answer
Answer and explanation

Correct answer

D. It allows dynamic invocation of methods at runtime.

Why

Method.invoke() enables the execution of a method on a given object instance dynamically, which is a core feature of Java reflection.

Test yourself on Java Annotations

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

Start free test
All Java Annotations questions →