"void main()"
summary
Live-refactors a Java 8 conference app to Java 22/23 (project on GitHub) with concrete, line-for-line changes: text blocks (no performance penalty), switch expressions with yield, pattern matching including primitive guard clauses, sealed types to limit subclasses, records and record patterns replacing verbose POJOs. Shows exhaustive enum switches, flow-scoped pattern variables, and a simplified void main() entry that compiles and runs (IDE may show squiggles but examples run on Java 23 EA), plus exact commands and files so the refactor can be reproduced locally.
AI-written summary · about
chapters (11)
- 0:00Modern Java updates
- 2:48Conference project overview
- 3:31Text blocks for strings
- 7:25Switch expressions
- 10:40Pattern matching
- 16:47Switch with primitives
- 19:18Sealed types
- 23:51Records
- 26:46Record patterns
- 28:52Simplified main method
- 30:18Constructor enhancements
related talks
51mRefactor Your Code to Java 20
01h 11mModern Java: This is not your father's Java anymore
50mTo Java 20 and Beyond
50mExploring what's new in Java in 2020.
59mFrom Legacy to Cutting-Edge: Live Refactoring Java 8 to 24
43mLearning modern Java the playful way
52mTo Java 21 and Beyond!
52mJava 22 and Beyond: A Roadmap of Innovations
