हिंदी

How do abstraction and encapsulation complement each other?

Advertisements
Advertisements

प्रश्न

How do abstraction and encapsulation complement each other?

लघु उत्तरीय
Advertisements

उत्तर

  • 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
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 2: Concept of Object Oriented Programming - EXCERCISE [पृष्ठ ३७]

APPEARS IN

सीबीएसई Computer Science with Python [English] Class 12
अध्याय 2 Concept of Object Oriented Programming
EXCERCISE | Q 7. | पृष्ठ ३७
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×