From https://openjdk.java.net/jeps/8277163
A class can be declared a value class with the value contextual keyword. If a concrete class is declared without the value contextual keyword, it is an identity class.
...
In most other ways, a value class declaration is just like an identity class declaration. It can have superinterfaces, type parameters, enclosing instances, inner classes, overloaded constructors, static members, and the full range of access restrictions on its members.
A class can be declared a value class with the value contextual keyword. If a concrete class is declared without the value contextual keyword, it is an identity class.
...
In most other ways, a value class declaration is just like an identity class declaration. It can have superinterfaces, type parameters, enclosing instances, inner classes, overloaded constructors, static members, and the full range of access restrictions on its members.
- relates to
-
JDK-8277163 Value Objects (Preview)
-
- Closed
-