You are correct in that security is the reason, but some tend to think security just means hackers breaking into your computer. The security referred to here is the integrity of the workings of the code. Access modifier allow class designers to restrict what any other classes can modify and the means by which it can be modified. Regardless of any notions of malicious intent, it ensures that the code works as intended and guards against outside code interfering with those workings.
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 838
Posting Genius
Offline 6,756 posts
since May 2007