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
What is the v-ptr?
Is swift a good first language?
Are there any special rules about inlining?
What is long in c++?
What is a pdb file?
Who discovered c++?
What ANSI C++ function clears the screen a) clrscr() b) clear() c) Its not defined by the ANSI C++ standard
How const int *ourpointer differs from int const *ourpointer?
Describe linkages and types of linkages?
What does std :: flush do?
Difference between a copy constructor and an assignment operator.
What are c++ tokens?
Distinguish between a # include and #define.
Explain how would you handle a situation where you cannot call the destructor of a local explicitly?
What are friend classes?