Searching turns up a simple definition: data hiding.
But, consider the following two examples:
1) First Example:
Class Emp
Encapsulation separates the concept of what something does from how it is implemented.
Encapsulation is a very important concept in Object Oriented Programming. It is hiding the data from other modules in the application. In your example 2, as you can see you can only get the age and that too using a getter method, but you can only set the value to the private member within that class and not outside it. This is the advantage of Encapsulation.