Showing posts with label non-sealed. Show all posts
Java sealed and non-sealed classes
January 29, 2023
Java
Java17
non-sealed
permits
sealed
About sealed classes and interfaces Starting Java 17 we can now allow additional class modifiers like sealed, non-sealed etc.
A sealed class or interface can be extended or implemented only by those classes and interfaces permitted to do so.
Following are the keywords related to sealed classes.New KeywordsEarlier we had only two options, allow subclasses to inherit the parent...