What are the differences between public, private, and
protected access?
Answer Posted / krishnachaitanya narne adeesh
Public data is used to access from any where in the program
means any class or any member function can utilize those
variables and member functions.
Where as Private data will not give access to any other
classes and also for derived classes it use those variables
only on particular class only.
Here Protected is similar to Private but difference is just
it gave access to its derived classes also. This is also
opposite to Public.
Is This Answer Correct ? | 46 Yes | 9 No |
Post New Answer View All Answers
What are the manipulators in c++?
Define a constructor?
What is a lambda function c++?
What is setbase c++?
What is #include cmath?
What is pointer -to-members in C++? Give their syntax?
Write a Program for dynamically intialize a 2 dimentional array. Eg:5x20, accept strings and check for vowels and display the no.finally free the space allocated .
What is decltype c++?
What are the benefits of c++?
Can turbo c++ run c program?
What is double in c++?
What is the basic of c++?
Explain unexpected() function?
How would you use the functions sin(), pow(), sqrt()?
What is a modifier in c++?