title: What's the difference between abstraction and encapsulation?
body: <p>In interviews I have been asked to explain the difference between abstraction and encapsulation.  My answer has been along the lines of</p>
  
  <ul>
  <li><p><strong>Abstraction</strong> allows us to represent complex real world in simplest manner. It is the process of identifying the relevant qualities and behaviors an object should possess; in other words, to represent the necessary feature without representing the background details.</p></li>
  <li><p><strong>Encapsulation</strong> is a process of hiding all the internal details of an object from the outside real world. The word "encapsulation", is like "enclosing" into a "capsule". It restricts clients from seeing its internal view where the behavior of the abstraction is implemented.</p></li>
  </ul>
  
  <p>I think with above answer the interviewer was convinced, but then I was asked, if the purpose of both is hiding, then why there is a need to use encapsulation.  At that time I didn't have a good answer for this.</p>
  
  <p>What should I have added to make my answer more complete?</p>