This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
The private members are not accessable from outside the class. So if you need to change a private member, all you have to wory about the other members of same class that are accessing it. So the code enhancement and maintenance is much easy. Compare that to a public member that could be called by any other member of any class. So to change that, you will have to possibly change all calling members. In nutshell, private modifier allows you to implement information hiding principle. Thanks Barkat
Encapsulation: by making fields private and methods public the state of the object cannot be accessed directly by anyone. But through the methods. They are responsible for checking that changes in the state don't cause the object to go to an inconsitent state. For instance, a color field in a traffic lights object cannot be set to pink.