title: What is encapsulation? How does it actually hide data?
body: <p>Searching turns up a simple definition: data hiding.</p>
  
  <p>But, consider the following two examples:</p>
  
  <p><strong>1) First Example:</strong>  </p>
  
  <pre><code>Class Employee
  {
      public int age;
  }
  </code></pre>
  
  <p><strong>2) Second Example:</strong>  </p>
  
  <pre><code>Class Employee
  {
      private int age;
  
      public int getAge(){return age;}
  }
  </code></pre>
  
  <p><strong>Question:</strong><br>
  In both the above specified examples, there is no data hiding, as <code>age</code> is either being modified by others or being viewed by others. Where is the data hiding? How does encapsulation help in the above examples?</p>