What are the differences between public, private, and
protected access?
Answer Posted / kalpana.y
Private is used for intialization of variables
eg:
int p,r;
public is used for function name
eg:
void display();
protected is used for void main()
eg:
void main()
class c;
| Is This Answer Correct ? | 24 Yes | 86 No |
Post New Answer View All Answers
Is python better than c++?
Describe linked list using C++ with an example.
Can char be a number c++?
What is vector pair in c++?
Describe exception handling concept with an example?
How do you decide which integer type to use?
What is the sequence of destruction of local objects?
What is the protected keyword used for?
Write about the use of the virtual destructor?
Is rust better than c++?
What is #include iostream in c++?
Write a program to find the Factorial of a number
What is the difference between #define debug 0 and #undef debug?
Why namespace is used in c++?
How the virtual functions maintain the call up?