Merged to OpenJDK master
OpenJDK
2025
A new programming model for the JVM
Key features and syntax
New 'value' modifier for declaring value classes
Reduced memory footprint and improved runtime performance
Immutable nature ensures safe concurrent access
Works with existing Java code and libraries
public value record Point(int x, int y) {
// Automatic equals, hashCode, toString
}
// Usage
Point p1 = new Point(10, 20);
Point p2 = new Point(10, 20);
System.out.println(p1.equals(p2)); // true
Declaring and using value objects in Java
JEP 401 marks a significant milestone in Java's evolution