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
A get method, also known as an accessor, is a method used to retrieve the value of an object's private instance variable. It provides read-only access to the data stored in the object.
Encapsulation is the concept of bundling data (instance variables) and methods (getters/setters) together within a class, hiding internal details from outside access.
Access modifiers are keywords that determine the accessibility or visibility of classes, methods, and variables. They control whether other parts of your program can use or modify certain elements.