What do you mean by public, private, protected and friendly?
Answer Posted / achal ubbott
public means access to the object of the class, created in
outside world.
private and protected are almost the same, except the
difference that protected members are inheritable and thus
can be used by derived class. These can be accessed only by
the public function members of the class.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is the real time example of encapsulation?
Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)
write knight tour problem which is present in datastructure
What is polymorphism and types?
Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.
Which method cannot be overridden?
How to hide the base class functionality in Inheritance?
Why is object oriented programming so hard?
INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?
Can destructor be overloaded?
Why is it so that we can have virtual constructors but we cannot have virtual destructors?
What is overloading in oop?
How is class defined?
What is purpose of inheritance?
What is difference between data abstraction and encapsulation?