What is class how does it accomplish data hiding in c++?
Answers
In C++, the class groups data members and functions under three access specifiers – private, protected and public, where private and protected members remain hidden from outside world and thereby support data hiding, so that only relevant and required information is exposed to the user and rest of the unnecessary information remains hidden from the user. The private and protected membes remain hidden from the user and the public members form an interface by providing the relevant and needed information to the outside world, which is nothing but data hiding.
Answer:
In C++, the class groups data members and functions under three access specifiers – private, protected and public, where private and protected members remain hidden from outside world and thereby support data hiding, so that only relevant and required information is exposed to the user and rest of the unnecessary information remains hidden from the user. The private and protected membes remain hidden from the user and the public members form an interface by providing the relevant and needed information to the outside world, which is nothing but data hiding.
PLZ MARK AS BRIANLIEST AND THX FOR THE SUPERB QUESTION