Java 20 major language and API improvements
Java 20 has been released in March 2023.
The following content is summarizing the most important changes to the Java API, the Java language, and the JVM introduced with Java 20.
For a more complete overview follow the links in the following sections referring to the official Oracle release documents.
Java 20 Language improvements
The following describes selected improvements of the Java language. See the Java 20 release notes. See Java Language Updates for Java SE 20.
Java 20 is introducing the following language enhancements as developer preview.
We are not diving into the details of these preview features and defer that until they are moving from preview for general availability.
Java 20 API improvements
The following describes selected improvements of the Java API. See the Java 20 release notes.
Java 20 is introducing the following API enhancements as developer preview or Incubator.
JEP 429 is introducing scoped values, which enable the sharing of immutable data within and across threads. They are preferred to thread-local variables, especially when using large numbers of virtual threads
JEP 436 is introducing virtual threads to the Java Platform. Virtual threads are lightweight threads that dramatically reduce the effort of writing, maintaining, and observing high-throughput concurrent applications.
JEP 437 is simplifying multithreaded programming by introducing an API for structured concurrency. Structured concurrency treats multiple tasks running in different threads as a single unit of work, thereby streamlining error handling and cancellation, improving reliability, and enhancing observability..
We are not diving into the details of these preview features and defer that until they are moving from preview for general availability.