What is the point of setters and getters in java? [duplicate]
The point of getters and setters, regardless of language, is to hide the underlying variable. This allows you to add verification logic when attempting to set a value – for example, if you had a field for a birth date, you might only want to allow setting that field to some time in the past. … Read more