What do you mean by public, private, protected and friendly?
Answer Posted / diya verma
Public : it is access modifier and also known as visibility mode.It is used to declare public members in a class.It is also used in inherit the derived class which shows public member of base class with the help of object of derived class in global scope.The public member can be accessed outside the class.
Private:It is access modifier and also known as visibility mode.It is used to accessed inside the class I.e the member of class is private.
1. All the public member will be private member of child class.
2.All the protected member will be private member of child class.
3.Private member can't be inherit.
Protected:It is access modifier and also known as visibility mode.
1.All public members will be protected member of child class.
2.All the protected member will be protected member of child class.
3.Private member can't be inherit.
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How does polymorphism work?
Hi friends I have experience of 6 months in website design and maintanence. Now i am looking for other IT jobs.. to switch platform. please post any interview you know in chennai.
2. Give the different notations for the class.\
Why do pointers exist?
What is abstraction in oop?
What is overriding in oop?
How to use CMutex, CSemaphore in VC++ MFC
Give two or more real cenario of virtual function and vertual object
What is class in oop with example?
Plese get me a perfect C++ program for railway/airway reservation with all details.
What is the difference between procedural programming and oops?
Can you explain polymorphism?
What is the point of oop?
What is encapsulation oop?
What is abstraction oop?