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