โ Java 21 (LTS) โ Released September 2023
Major Highlights:
- โ Virtual Threads (Project Loom): Finalized! Makes writing high-throughput concurrent apps easier.
- ๐งต
java.lang.Thread
now supports lightweight threads - ๐งฑ Record Patterns & Pattern Matching for switch: Better, cleaner code when using pattern matching
- ๐ Sequenced Collections: New interfaces like
SequencedCollection
,SequencedSet
,SequencedMap
- ๐งช Scoped Values (Preview): A safer alternative to thread-local variables
๐ฎ Java 22 (March 2024 – Non-LTS)
Key Features:
- ๐งต Structured Concurrency (Preview): Easier thread management
- ๐ Stream Gatherers (Preview): Create custom collection-style operations
- โก Improved pattern matching and memory segment APIs
๐งช Upcoming Java 23 (September 2024, next LTS is Java 25)
- Likely to include more stable Loom, Panama, and Valhalla features
- Expected:
- Finalization of Scoped Values
- Improvements in foreign function & memory API
- More enhancements to JVM performance
๐ง Tooling/Dev Enhancements
- Better performance in
javac
- JavaFX improvements
- Stronger integration with modern build tools like Gradle, Maven, and IDE support
i dont like it