Java Feature Spotlight: Sealed Classes


Java SE 15 (Sept 2020) introduces sealed classes as a preview feature. Sealing allows classes and interfaces to have more control over their permitted subtypes; this is useful both for general domain modeling and for building more secure platform libraries…

More at https://www.infoq.com/articles/java-sealed-classes/