๐Ÿ’ปap computer science a review

Accessor Method

Written by the Fiveable Content Team โ€ข Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examโ€ขWritten by the Fiveable Content Team โ€ข Last updated September 2025

Definition

An accessor method, also known as a getter method, is a public method in Java that allows the retrieval of the value of an instance variable. It provides indirect access to private variables by returning their values.

"Accessor Method" also found in: