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
C is to C++ as 1 is to a) What the heck b) 2 c) 10
How would you differentiate between a pre and post increment operators while overloading?
What is increment operator in c++?
Refer to a name of class or function that is defined within a namespace?
What is the difference between structures and unions?
To which numbering system can the binary number 1101100100111100 be easily converted to?
Explain stack & heap objects?
Which is not an ANSII C++ function a) sin() b) tmpnam() c) kbhit()
Why was c++ made?
What is the main use of c++?
What is constructor c++?
what is a reference variable in C++?
Can java be faster than c++?
What is an incomplete type in c++?
What are the restrictions apply to constructors and destructors?