I am beginner programmer. I have been learning programming language C++, C sharp and Java. I have read and listen from many programmers that good programming style is to never make fields of an object public. They should always be private and use set/get methods to access them from outside of the boundary of object. Why it is like this?? Only security purpose or something else also to use private specification?
Bookmarks