Package net.jrodolfo.java_evolution.java20
package net.jrodolfo.java_evolution.java20
Examples for features introduced or refined in Java 20.
Java 20 was mostly a refinement release. Several important features were still moving through preview or incubator cycles: record patterns, pattern matching for switch, virtual threads, scoped values, structured concurrency, the Foreign Function and Memory API, and the Vector API. The package shows runnable examples where JDK 25-compatible syntax exists and uses notes where the original API required incubator modules or changed before finalization.
-
ClassDescriptionExplains the Foreign Function and Memory API second preview in Java 20.Demonstrates pattern matching for switch as refined in the Java 20 fourth preview.Demonstrates record patterns as refined in the Java 20 second preview.Address record nested inside
RecordPatternsSecondPreviewExamples.Customer.Customer record used to demonstrate nested record deconstruction.Explains scoped values, introduced as an incubating API in Java 20.Explains structured concurrency as a Java 20 second incubator feature.Explains the Vector API fifth incubator in Java 20.Explains virtual threads as a Java 20 second preview feature.