Primitive Types in Patterns, instanceof, and switch (Preview)
Patterns, instanceof, and switch can mention primitive types. This is a preview.
Second preview in Java 24 (JEP 488). Third preview in Java 25 (JEP 507). It is not final in Java 25.
JDK 23 · JSR 398
JDK 23 is Java SE 23, JSR 398, generally available on 17 September 2024. Markdown documentation comments become standard. Primitive patterns, module import declarations, and flexible constructor bodies are previews. ZGC uses the generational mode by default. Stream gatherers and the class-file API are still previews.
Patterns, instanceof, and switch can mention primitive types. This is a preview.
Second preview in Java 24 (JEP 488). Third preview in Java 25 (JEP 507). It is not final in Java 25.
import module M is a preview. It imports the public types of the packages a module exports.
Final in Java 25 (JEP 511).
Statements before super(...) are previewed again.
First preview in Java 22 (JEP 447). Final in Java 25 (JEP 513).
The compact-program preview continues.
Final in Java 25 as compact source files (JEP 512).
Stream gatherers are previewed a second time.
Final in Java 24 (JEP 485).
OpenJDK JEP 473 (leaves JavaMastery)
Related reading: Streams and Optional
The class-file API is previewed a second time.
Final in Java 24 (JEP 484).
Structured concurrency is previewed a third time.
Still a preview in Java 25.
OpenJDK JEP 480 (leaves JavaMastery)
Related reading: Concurrency
Scoped values are previewed a third time.
Final in Java 25 (JEP 506).
OpenJDK JEP 481 (leaves JavaMastery)
Related reading: Concurrency
The memory-access methods of sun.misc.Unsafe are deprecated for removal. They are not removed in this release.
The Vector API incubates an eighth time.
Still incubating in Java 25.
ZGC’s default mode is generational. Non-generational ZGC is still available in this release.
Generational ZGC arrived in Java 21 (JEP 439). Java 24 removes the non-generational mode (JEP 490).
OpenJDK JEP 474 (leaves JavaMastery)
Related reading: JVM and memory
Documentation comments can be written in Markdown as well as in the traditional comment syntax.
String templates are not in this release. Their last preview in this curriculum is Java 22. There is no Java 23 sample. The language changes here were previews. Later final forms are the Java 24 gatherers example and the Java 25 module-import and constructor examples.
Sources. General availability, JSR 398, and the JEP list: OpenJDK JDK 23. OpenJDK JDK 23 (leaves JavaMastery)