Hacker News new | ask | show | jobs
by gavinray 1416 days ago
JDK 17 record classes:

  record User(String name, Integer age, Boolean isActive) {}
https://docs.oracle.com/en/java/javase/18/language/records.h...
1 comments

If you have mutable members you can still absolutely do myRecord.member().methodThatMutates().

The only way to stop this is to remove the mutable methods from the interface entirely, which is what I'm complaining about.