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
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
