Skip to content
Sharp

Reflection API · interview question

Which Reflection method would you use to obtain a class’s superclass?

Multiple choiceMediumchapter-16-curatedpremiumreflection-apidynamic-class-loading
Choose one answer
Answer and explanation

Correct answer

A. GetSuperclass()

Why

The getSuperclass() method of the Class class returns the superclass of a given class, or null if the class is a primitive type or has no superclass.

Test yourself on Reflection API

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

Start free test
All Reflection API questions →