Skip to content
Sharp

Reflection API · interview question

Which of the following is NOT a valid use of MethodHandles?

Multiple choiceEasychapter-16-curatedpremiumreflection-apimethodhandles
Choose one answer
Answer and explanation

Correct answer

A. Accessing private methods of another class without permission.

Why

MethodHandles respect Java's access control rules. Accessing private methods of another class without proper permissions is not allowed, maintaining encapsulation and security.

Test yourself on Reflection API

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

Start free test
All Reflection API questions →