Sealed classes restrict which other classes can inherit them.
Sealed classes allow you to control the class hierarchy by specifying which classes can extend them. This is useful for domain modeling, where you want to ensure that only specific classes can represent certain domain concepts. For example, in an e-commerce application, a sealed `Payment` class could only permit `CreditCard` and `PayPal` as its subclasses, preventing unexpected payment methods from being introduced.