3 ms·
this too. Records are basically classes with everything public right ?
by sandGorgon 4y ago
this too. Records are basically classes with everything public right ?
- kaba0 4y agoRecords are classes with a canonical constructor that lists every field it has. The fields themselves are not public, but a method with the same name is automatically generated for each (basically a getter, just not getName(), but name() as the former is not consistent (what should be the getter for field Xx?). This result in records being shallowly immutable.