Pattern Matching for switch (Second Preview)
Pattern matching for switch is previewed again. It is not final.
First preview in Java 17 (JEP 406). Final in Java 21 (JEP 441).
OpenJDK JEP 420 (leaves JavaMastery)
Related reading: Control flow
JDK 18 · JSR 393
JDK 18 is Java SE 18, JSR 393, generally available on 22 March 2022. The charset default becomes UTF-8. The JDK includes a simple web server. Pattern matching for switch is a second preview. Finalization is deprecated for removal.
Pattern matching for switch is previewed again. It is not final.
First preview in Java 17 (JEP 406). Final in Java 21 (JEP 441).
OpenJDK JEP 420 (leaves JavaMastery)
Related reading: Control flow
The foreign function and memory API incubates a second time.
First incubator in Java 17 (JEP 412). Preview in Java 19 (JEP 424).
The Vector API incubates a third time.
Still incubating in Java 25 (JEP 508).
Charset.defaultCharset() is UTF-8 unless the user overrides it. Programs that assumed the operating system’s charset can change behavior.
OpenJDK JEP 400 (leaves JavaMastery)
Related reading: Strings
Finalizers are deprecated for removal. The deprecation is the change in this release. Finalizers still run.
jwebserver serves static files from a directory. It is a tool for development and testing, not a production server.
OpenJDK JEP 408 (leaves JavaMastery)
Related reading: Networking and HTTP
Javadoc can include code snippets from source files, so an example can be compiled rather than copied into a comment.
Java 18 does not finalize virtual threads, record patterns, or structured concurrency. Those are not in this release. There is no Java 18 sample. UTF-8 by default is a change of default, not a new API, and jwebserver is a command-line tool rather than a small library program.
Sources. General availability, JSR 393, and the JEP list: OpenJDK JDK 18. OpenJDK JDK 18 (leaves JavaMastery)