What are the differences between public, private, and
protected access?
Answer Posted / koushik k reddy
Private:
It cannot be accessed by object and cannot be inherited, will be used only by the member functions of the class
Protected:
It cannot be accessed by the object and used by the member functions of the class can be inherited to first level of inheritance
Public:
It can be accessed by the objects and can be inherited to any level
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are associate containers?
What is class and structure in c++?
Should a constructor be public or private?
What are the 4 types of library?
What is this pointer in c++?
What is a buffer c++?
What is the role of C++ shorthand's?
Explain class invariant.
Can you overload the operator+ for short integers?
What is the difference between structure and class?
Can you please explain the difference between static and dynamic binding of functions?
What are member functions used in c++?
What is the difference between an enumeration and a set of pre-processor # defines?
What is diamond problem in c++?
Why do we use pointers in c++?