Skip to content

Glossary: Java Basics

Record

Also written: records

A one-line, immutable type for plain data, like `record MenuItem(String name, int priceCents) {}`. Java gives it a constructor, accessors, `toString` and an `equals` that compares contents.

Where the book teaches it

Related terms

ComponentAccessorImmutableClass