English

How do abstraction and encapsulation complement each other?

Advertisements
Advertisements

Question

How do abstraction and encapsulation complement each other?

Short Answer
Advertisements

Solution

  • Encapsulation combines data and the methods operating on that data into one unit, usually a class.
  • Abstraction shows only the essential features of that class and hides complex implementation details.

Thus, encapsulation provides the mechanism to implement abstraction: the class keeps internal details together and exposes only the required public interface.

shaalaa.com
  Is there an error in this question or solution?
Chapter 2: Concept of Object Oriented Programming - EXCERCISE [Page 37]

APPEARS IN

CBSE Computer Science with Python [English] Class 12
Chapter 2 Concept of Object Oriented Programming
EXCERCISE | Q 7. | Page 37
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×