Skip to content
Sharp

Language Upgrades · interview question

Which of the following is NOT a valid modifier for a class extending a sealed class?

Multiple choiceEasychapter-12-curatedpremiumlanguage-upgradessealed-classes
Choose one answer
Answer and explanation

Correct answer

B. Private

Why

A class cannot be declared 'private' if it extends a sealed class, as this would prevent it from being accessed or instantiated outside its own definition, conflicting with accessibility rules.

Test yourself on Language Upgrades

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

Start free test
All Language Upgrades questions →