TAG · 3 ARTICLES
#sealed-classes
- JAVAJava 21 features for AI apps: records, sealed types and moreLLM code has three hard parts: messy JSON, replies that come in many shapes, and calls that take seconds. Modern Java has a feature for each. Here is how records, sealed types, pattern matching, text blocks and virtual threads fit AI work.17 Nov 2026 · 8 min
- JAVAPattern matching for switch in Java 21, with examplesJava 21 lets switch match on types, not just constants. Here is how it replaces the old if-instanceof-cast ladder, how when guards and case null work, the dominance and exhaustiveness rules, and how record patterns unpack data right in the case label.16 Nov 2026 · 4 min
- JAVAJava sealed classes and interfaces explained, with examplesA sealed class says exactly which classes may extend it, and the compiler enforces the list. Here is why that matters, the rules for permits, final, sealed and non-sealed, and how sealed types plus records give you switch statements the compiler can check.16 Nov 2026 · 5 min