Introduction
Get and set accessors let you read and change values inside an object safely.
When you want to control how a value is read or changed in a class.
When you want to check or change data before saving it.
When you want to hide the details of how data is stored.
When you want to make some values read-only or write-only.
When you want to add extra actions when a value changes.