Skip to content
Sharp

Language Upgrades · interview question

Why might an architect choose sealed classes for an e-commerce domain model?

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

Correct answer

B. To ensure only approved payment methods can be subclassed.

Why

Sealed classes can be used to restrict and control which payment methods or other sensitive components can be subclassed, ensuring only valid and pre-approved implementations are possible, maintaining domain integrity.

Test yourself on Language Upgrades

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

Start free test
All Language Upgrades questions →