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
| Submitted | Title on HN | Points | Comments |
|---|---|---|---|
| Oct 18, 2026 | Java sealed classes and exhaustive pattern matching by hnisjafx40 | 189 | 151 |