Virtual threads
Virtual threads (Java 21) are very cheap threads managed by the JVM.
Pattern matching for switch
Pattern matching for `switch` (Java 21) lets a `switch` choose code by the type of a value, and even add a condition with `when`.
Record patterns
A record pattern (Java 21) takes a record apart inside `instanceof` or `switch`, giving you its fields as variables.
Sequenced collections
Sequenced collections (Java 21) add a common way to work with the first and last element and to reverse any collection that has a defined order.