ProLesson 13.5Advanced3 min readUpdated 30 October 2026
Java 18 to 21: virtual threads and pattern matching
UTF-8 by default, then Java 21 LTS with virtual threads, record patterns, pattern-matching switch and sequenced collections.
Java 21 (September 2023) is one of the most important LTS releases since Java 8. Here's what led up to it and what it delivered.
01Java 18 to 20 highlights
- UTF-8 by default on every platform (Java 18, JEP 400). No more "works on Linux, garbled on Windows".
- Simple web server for quick testing:
jwebserver(Java 18). @snippetin Javadoc for compiled, highlighted code examples (Java 18).- Previews of virtual threads, record patterns and pattern-matching switch (Java 19 and 20).
Loading the rest of the lesson…