4 ms·
> Getters and Setters? You probably don't need them. Classes can have public member variables. We do need them if the objects interact with a lot the libraries
by avgcorrection 5y ago
> Getters and Setters? You probably don't need them. Classes can have public member variables.
We do need them if the objects interact with a lot the libraries that we use. Libraries that we didn’t make. They expect get/set.
I agree that getters/setters are very overrated. I tend to make public-final fields when I can. Most of the time I can’t though.