The following describes selected improvements of the Java language. See the Java 21 release notes. See Java Language Updates for Java SE 21.
With Java 21 the following language enhancements are now generally available
The following describes selected improvements of the Java language. See the Java 21 release notes. See Java Language Updates for Java SE 21.
With Java 21 the following language enhancements are now generally available
Unresolved directive in <stdin> - include::../../../../../../../../src/main/java/twentyone/lang/Record.java[tag=recordPatternMatchingWithInstanceOf]Unresolved directive in <stdin> - include::../../../../../../../../src/main/java/twentyone/lang/Record.java[tag=recordPatternMatchingWithSwitch]Record patterns with switch support many more additional features like when clauses. Read more on the Java 21 language document for Pattern Matching for switch Expressions and Statements.
The following describes selected improvements of the Java API. See the Java 23 release notes.
Java 23 is introducing the following API enhancements as developer preview or Incubator.
JEP 466 is continuing with Class-File API, standard API for parsing, generating, and transforming Java class files
JEP 473 is continuing with Stream Gatherers. This will allow stream pipelines to transform data in ways that are not easily achievable with the existing built-in intermediate operations
JEP 480 is continuing with 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..
JEP 481 is continuing with 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 469 is continuing with Vector API, introduces an API to express vector computations that reliably compile at runtime to optimal vector instructions on supported CPU architectures, thus achieving performance superior to equivalent scalar computations.
The following describes selected improvements of the Java language. See the Java 23 release notes. See Java Language Updates for Java SE 23.
Java 23 is introducing the following language enhancements as developer preview.
JEP 455 is starting with Primitive Types in Patterns, instanceof, and switch (Preview) as developer preview. Enhance pattern matching by allowing primitive type patterns in all pattern contexts, and extend instanceof and switch to work with all primitive types.
JEP 476 is starting with Module Import Declarations as developer preview. Enhance the Java programming language with the ability to succinctly import all of the packages exported by a module. This simplifies the reuse of modular libraries, but does not require the importing code to be in a module itself.
JEP 482 is continuing with Flexible Constructor Bodies as developer preview. In constructors in the Java programming language, allow statements that do not reference the instance being created to appear before an explicit constructor invocation.
JEP 477 is continuing with Implicitly Declared Classes and Instance Main Methods.
Before Java 23 HTML JavaDoc syntax is verbose and hard to read in source code.
Unresolved directive in <stdin> - include::../../../../../../../../src/main/java/twentythree/tooling/MarkdownDocumentationComments.java[tag=basicFormattingBeforeJava23]Unresolved directive in <stdin> - include::../../../../../../../../src/main/java/twentythree/tooling/MarkdownDocumentationComments.java[tag=basicFormattingWithJava23]Java 23 Markdown JavaDoc is clean and intuitive to write.
The following describes selected improvements of the Java tooling. See the Java 23 release notes.
Java 23 is introducing the following tooling enhancements.
JEP 467 is adding the Markdown Documentation Comments. This enables JavaDoc documentation comments to be written in Markdown rather than solely in a mixture of HTML and JavaDoc @-tags.
The following describes selected improvements of the Java API. See the Java 22 release notes.
Java 22 is introducing the following API enhancements as developer preview or Incubator.
JEP 446 is continuing with 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 457 is starting with a Class-File API to provide a standard API for parsing, generating, and transforming Java class files. This could eliminate the need for libraries like ASM.
JEP 453 is continuing with 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..
JEP 461 is starting Stream Gatherers. This will allow stream pipelines to transform data in ways that are not easily achievable with the existing built-in intermediate operations