Encapsulation is the clear separation between the external interface of a class and its internal implementation; that is, the packaging together of properties and methods (or data and operations) for an object.
Encapsulation hides the implementation (internal structure) of an object from the surrounding system. Other objects can access only properties and methods that define the external characteristics of the object.
An object can hide some or all of its implementation from other objects, but can provide methods by which other objects can manipulate its internal state.
An object is like the proverbial engineering "black box". You can change the way a method is implemented without changing the object’s interface or its relationships with other objects.
You can hide implementation details to:
Protect an object from arbitrary and unintended use, or from accidental corruption.
Hide the implementation details of an object from the users of that object, so those users understand the class interface rather than its implementation. This enables you to change the implementation of an object without affecting other users of the object.
Properties are protected by default.