What are the differences between public, private, and
protected access?
Answer Posted / golledla prathap reddy
public data can access anybody in the program.
private data can access olny members of that class.
protected also same like private but the difference is it
can access by derive class also.
we can see the use of protected data in inheritance.
| Is This Answer Correct ? | 64 Yes | 12 No |
Post New Answer View All Answers
What is a class template?
Can c++ do everything c can?
Will a catch statement catch a derived exception if it is looking for the base class?
What is the use of endl in c++?
What is pure virtual function? Or what is abstract class?
What parameter does the constructor to an ofstream object take?
What is the benefit of c++?
Is c++ a software?
Can circle be called an ellipse?
What is the difference between while and do while loop?
Why is c++ not purely object oriented?
Define virtual constructor.
Difference between declaration and definition of a variable.
What are default parameters? How are they evaluated in c++ function?
What is java and c++?