Skip to content
Sharp

Reflection API · interview question

What role does the MethodHandles.Lookup class play when working with MethodHandles?

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

Correct answer

C. It manages security permissions for accessing methods and fields.

Why

MethodHandles.Lookup is responsible for managing security permissions, ensuring that only appropriately privileged code can access certain methods or fields, similar to how reflection checks access permissions.

Test yourself on Reflection API

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

Start free test
All Reflection API questions →