how are private members of a class different from public members. don't spam
Answers
Answered by
6
Answer:
public - members are accessible from outside the class. private - members cannot be accessed (or viewed) from outside the class. protected - members cannot be accessed from outside the class, however, they can be accessed in inherited classes.
Explanation:
Hope it helps you ☺︎︎
Answered by
4
Answer:
A public member is accessible from anywhere outside the class but within a program. You can set and get the value of public variables without anymember. A private member variable or function cannot be accessed, or even viewed from outside the class. Only the class and friend functions can access private members
Explanation:
Answer for your Question..
Similar questions