8 ms·
Records were introduced in Java 14 [1]. An immutable DTO, with minimal boilerplate, that still behaves a class. Example: record Point(int x, int y) {} [1] htt
by martinp 5y ago
Records were introduced in Java 14 [1]. An immutable DTO, with minimal boilerplate, that still behaves a class. Example:
record Point(int x, int y) {}
[1] https://blogs.oracle.com/javamagazine/records-come-to-java https://blogs.oracle.com/javamagazine/records-come-to-java
- Twisol 5y agoThey were a preview feature until Java 16, though, so they probably haven't seen wide use yet. https://openjdk.java.net/jeps/395 https://openjdk.java.net/jeps/395 Java 16 was only released within the last few weeks! (Gradle still has some trouble compiling it or running on it; Gradle 7 should be dropping soon with explicit Java 16 support.)