Advertisements
Advertisements
प्रश्न
Explain data hiding with respect to OOP.
स्पष्ट करा
Advertisements
उत्तर
Data hiding is the mechanism of restricting direct access to the data of a class from outside the class.
- It protects data from accidental or intentional misuse.
- It is achieved by making data members
private. - Private data can be accessed only through the methods of the same class, while public members can be accessed from outside.
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
