Skip to content

Glossary: Java Beyond the Basics

Record

Also written: records

A small class that holds data and automatically gets equals, hashCode and toString. Records are immutable and can't extend a class.

Where the book teaches it

Related terms

ImmutableCompact constructorPattern matching