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 is basic if statement syntax?
On throwing an exception by the animal constructor in p = new animalq, can memory leak occur?
Why is c++ still used?
Explain friend class?
How do you flush std cout?
What are the advantages of early binding?
What is encapsulation in c++ with example?
Can notepad ++ run c++?
What is the difference between C and CPP?
What is the use of dot in c++?
What is auto type c++?
What are the stages in the development cycle?
What is a float in c++?
What do you mean by translation unit?
what are the events occur in intr activated on interrupt vector table