Skip to content

A small and easy understandable example of a sealed-class, new with Java 15. For further information see: https://openjdk.java.net/jeps/360

Notifications You must be signed in to change notification settings

mkemmerz/sealed-classes-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Java's sealed classes

A small and easy understandable example of a sealed-class, new with Java 15. For further information see: https://openjdk.java.net/jeps/360 A sealed class only allows a pre-defined amount of subclasses. The keyword 'permits' is used to define those subclasses.

Subclasses of a sealed have different behaviors. A 'non-sealed' subclass can be extended by every other class. A 'final' subclass can't be extended by anyone.

About

A small and easy understandable example of a sealed-class, new with Java 15. For further information see: https://openjdk.java.net/jeps/360

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages