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
When do we use copy constructors?
How is static data member similar to a global variable?
How to allocate memory dynamically for a reference?
Write a code/algo to find the frequency of each element in an array?
What is late binding c++?
What is copy constructor? Can we make copy constructor private in c++?
What is dev c++ used for?
What is jump statement in C++?
What is fixed in c++?
What are the syntactic rules to be avoid ambiguity in multiple inheritance?
What does namespace mean in c++?
What is an overflow error?
Is swift faster than c++?
What are the manipulators in c++?
What is enum class in c++?