Neil Madden personal blog

Java sealed classes and exhaustive pattern matching

Java 17 introduced sealed classes, which allow you to explicitly list the allowed sub-types of an interface or base class. For example, here’s a toy example using a sealed interface and records (in…
Points
189
HN comments
151
Submissions
1
Cited by
0 commenters

Programming LanguagesSoftware Engineering2026

On Hacker News

SubmittedTitle on HNPointsComments
Oct 18, 2026Java sealed classes and exhaustive pattern matching by hnisjafx40189151

More from Neil Madden

All 7 posts →

Related posts from the same era