Skip to content

Glossary: Algorithms Beyond the Basics in Java

record

Also written: records

A short Java class that holds fixed fields, like `Pair(low, high)`, and compares by those fields. Records work well as map keys because they get `equals` and `hashCode` automatically.

Where the book teaches it

Related terms

identity vs equals