JDK 20 / Java 20 is officially released. JDK 20 is a short-term maintenance release and will be supported for six months. Nevertheless, it can still be used in a production environment. According to the development plan, the next LTS version is JDK 21, which will be released in September 2023.
This release includes 7 JEPs (all in various incubation and preview stages), as well as hundreds of smaller feature enhancements and thousands of bug fixes:
Scoped Values enters incubation phase
Introducing Scoped Values, which enable sharing immutable data within and across threads. They are preferred over thread-local variables, especially when using a large number of virtual threads.
Record Patterns enters preview 2
Record Patterns can deconstruct the value of record, and Record patterns and Type patterns can realize powerful, declarative, composable data navigation and processing forms through nesting.
switch Pattern Matching for switch enters preview 4
use switch
Pattern matching of expressions and statements, and extensions to the pattern language to enhance the Java programming language.Extend pattern matching to switch
allowing expressions to be tested against several patterns, so that complex data-oriented queries can be expressed concisely and safely.
Foreign Function & Memory API Enters Preview 2
Introduces an API through which Java programs can interoperate with code and data outside of the Java runtime. By efficiently calling external functions, and safely accessing external memory, the API enables Java programs to call native libraries and manipulate native data without the vulnerabilities and dangers of JNI.
Virtual Threads enters preview 2
Introduce virtual thread for Java, virtual thread is a lightweight thread implemented by JDK, which has been proven to be very useful in other multi-threaded languages, such as Goroutine in Go and process in Erlang. Virtual thread avoids the extra cost of context switching, takes into account the advantages of multi-threading, simplifies the complexity of high-concurrency programs, and can effectively reduce the workload of writing, maintaining and observing high-throughput concurrent applications.
Structured Concurrency Enters Incubation Phase 2
JDK 19 introduces structured concurrency, which is a multi-threaded programming method designed to simplify multi-threaded programming through the structured concurrency API, not to replace java.util.concurrent.
Structured concurrency treats multiple tasks running in different threads as a single unit of work, simplifying error handling, improving reliability, and enhancing observability. That is, structured concurrency preserves the readability, maintainability, and observability of single-threaded code.
Vector API (Vector API) enters the 5th incubation stage
Vector computation consists of a sequence of operations on vectors. The Vector API is used to express vector computations that can be reliably compiled at runtime to the optimal vector instructions on supported CPU architectures, resulting in better performance than equivalent scalar computations. The goal of the vector API is to provide users with concise, easy-to-use and platform-independent expression of a wide range of vector calculations.
More details can be viewed: https://openjdk.org/projects/jdk/20/
Download: https://jdk.java.net/20/
#JDK #Java #officially #News Fast Delivery