Skip to content

Glossary: Java Basics

Compact constructor

Also written: compact constructors

A block inside a record, written as the record's name with no parentheses, that runs when a record is created and before the values are stored. It's where you reject bad values, such as a price of 0 or less.

Where the book teaches it

Related terms

RecordConstructorComponent