News for hackers. Stuff that matters.
Re:Java 14 Feature Spotlight: Records by _old_dude_ on Tuesday February 04, 2020 @01:24PM (#22239052)
Record are product types, with union types (sealed types in Java speak) you get algebraic data type, you can take a look to SML to understand why there will be used a lot.

Record have an automatic way to propagate annotations from the record component to the generated methods/fields and comes with native support of serialization (like enums).

Re:Java 14 Feature Spotlight: Records by llcoolv on Tuesday February 04, 2020 @04:07PM (#22240974)
Could you show an example of it? In none of the materials published so far there is anything even remotely similar to what you are suggesting.
Re:Java 14 Feature Spotlight: Records by krzyk on Tuesday February 04, 2020 @04:51PM (#22241407)
http://cr.openjdk.java.net/~briangoetz/amber/datum.html

There you can read about algebraic data types in java, in Java 14 you get preview for records in Java 15 probably you'll get preview for sealed types - they were developed together for some time, only recently there was a split.