1 min readAug 25, 2020
Agree. Private is set not to have getter and setter. Encapsulation is the avoid external object access internal value that should be hidden.
In my text, it is referring to the case where your variable value to be accessed (e.g. get and set) externally, do you make them public or still keep them private, and make function to get and set them only? If it is just a data object class, do we still keep them private with only getter and setter?