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
Which recursive sorting technique always makes recursive calls to sort subarrays that are about half size of the original array?
an operation between an integer and real always yeilds a) integer result b) real result c) float result
What are c++ templates used for?
What things would you remember while making an interface?
What is the difference between ++ count and count ++?
What is the difference between the functions memmove() and memcpy()?
What is c++ runtime?
Write a code/algo to find the frequency of each element in an array?
What is new in c++?
What is function declaration in c++ with example?
What is an object in c++?
What is doubly linked list in c++?
Is vector a class in c++?
What are stacks? Give an example where they are useful.
Explain the different access specifiers for the class member in c++.