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
Difference between struct and class in terms of access modifier.
What is the difference between global variables and local variable
Is it possible to provide default values while overloading a binary operator?
What is the best book for c++ beginners?
Why the usage of pointers in C++ is not recommended ?
what Is DCS ? what i will get benefit when i did?
On throwing an exception by the animal constructor in p = new animalq, can memory leak occur?
Why do we use setw in c++?
What is the best way to declare and define global variables?
What is a Default constructor?
Does there exist any way to make the command line arguments available to other functions without passing them as arguments to the function?
How are the features of c++ different from c?
How can I learn dev c++ programming?
What is the use of 'using' declaration in c++?
What is malloc in c++?