Question: What is encapsulation?

  1. defining classes by focusing on what is important for a purpose
  2. hiding the data and implementation details within a class
  3. making all methods private
  4. using words to define classes

Answer: The correct answer of the above question is Option B:hiding the data and implementation details within a class