Member-only story
JAVA 22 Features
This article is about the simple introduction of Java 22 and its new features.
Java 22 has been released on March 19, 2024.
JDK 22 delivers 12 enhancements that are significant enough to warrant their own JDK Enhancement Proposals (JEPs), including seven preview features and one incubator feature:
1. JEP 423: Regional Pinning for G1
Reduce latency by implementing region pinning in G1, so that garbage collection need not be disabled during Java Native Interface (JNI) critical regions.
2. JEP 447: Statements before super (…) [Preview]
In constructors, allow for statements that do not reference the instance being created to appear before an explicit constructor invocation.
Value:
Gives developers greater freedom to express the behavior of constructors, enabling the more natural placement of logic that currently must be factored into auxiliary static methods, auxiliary intermediate constructors, or constructor arguments.
Preserves the existing guarantee that constructors run in top-down order during class instantiation, ensuring that code in a subclass constructor cannot interfere with superclass instantiation.
Does not require any changes to the Java Virtual Machine. This Java language feature relies only on the current ability of the JVM to verify and execute code that appears before explicit constructor invocations within constructors.



