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
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
