Data Oriented Programming, Beyond Records

Robbe Pincket robbepincket at live.be
Thu Jan 15 01:09:36 UTC 2026


AFAIK `final class Point2D(int x, int y) {}` does not work? You need the following:

```java
class Point(int x, int y) {
    private final component int x;
    private final component int y;
}
```
So that's the benefit. No need to specify the fields a second time.


If you want it to be equivalent to the record declaration, you also have to make the class final (and extend Record.)

Ah, seems I made some mistakes while copying over the question :facepalm:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-spec-observers/attachments/20260115/3657c236/attachment-0001.htm>


More information about the amber-spec-observers mailing list