Skip to content
Sharp

Language Upgrades · interview question

In the context of sealed classes, what does it mean for a subclass to be marked as 'non-sealed'?

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

Correct answer

D. It can be further subclassed without restriction.

Why

Marking a subclass as 'non-sealed' indicates that it removes the restrictions imposed by the sealed class, allowing it to be freely subclassed without listing subclasses in a permits clause.

Test yourself on Language Upgrades

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

Start free test
All Language Upgrades questions →