4 ms·
> Java (and C++) have a rudimentary form of access control where members can be marked private ... ostensibly in order to perform validity checks on proposed mo
by mcculley 6y ago
> Java (and C++) have a rudimentary form of access control where members can be marked private ... ostensibly in order to perform validity checks on proposed modification.
This is not the biggest reason I generally mark members as private. I tend to develop immutable classes wherever possible. I use private to indicate what is exempt from requiring API documentation.
- bitwize 6y agoYeah, OO access control is in no wise a security measure, it's there to separate interface from implementation as you said.