study guides for every class

that actually explain what's on your next test

Accessor Method

from class:

AP Computer Science A

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.

© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.