Sealed classes restrict which other classes can extend them.
Sealed classes, introduced in Java 17, allow developers to specify a restricted set of subclasses through the `permits` clause. This helps maintain control over class hierarchies, which is particularly useful in complex systems. For example, in an e-commerce platform, a `sealed class Payment permits CreditCard, PayPal {}` ensures that only specified types can be a payment method, enhancing security and maintainability.