What are the differences between public, private, and
protected access?
Answer Posted / manjusinga
public is used for global access that is its scope is not
only within the class but also outside the class.
private is used only in the class class in which it is
defined.It cannot be accessible by its derived members.
protected is used within the class in which it is defined
and derived members of it can also access it.
| Is This Answer Correct ? | 133 Yes | 10 No |
Post New Answer View All Answers
what are the decision making statements in C++? Explain if statement with an example?
What is extern c++?
Can I uninstall microsoft c++ redistributable?
Do vectors start at 0 c++?
What is the benefit of c++?
Difference between pointer to constant and constant pointer to a constant. Give example.
What is std :: endl?
Can constructor be static in c++?
What is the use of function pointer?
What is pointer to array in c++?
What is the difference between set and map in c++?
Why struct is used in c++?
What are the uses of static class data?
How can a called function determine the number of arguments that have been passed to it?
Why is the function main() special?