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.
Ezzaral
Posting Genius
15,985 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
JamesCherrill
Posting Genius
6,332 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,070
James is correct. Please start a new thread if you have a question and state it more clearly. What you posted is rather vague.
Thread closed.
Ezzaral
Posting Genius
15,985 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847