Skip to content

Glossary: Java Basics

Accessor

Also written: accessors

A method a record creates for each of its components, named after the component. For `MenuItem(String name, int priceCents)` you read the price with `priceCents()`, with no `get` prefix.

Where the book teaches it

Related terms

ComponentGetterRecord