What is the difference between public, private, protected
inheritance?

Answer Posted / priya

public: class members are access from the outside the class
private: class members can access only within the class
protected:class members can access inside the same package

Is This Answer Correct ?    104 Yes 51 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the most powerful coding language?

820


Why is it necessary to use a reference in the argument to the copy constructor?

850


What is a constructor and how is it called?

787


What is the hardest coding language to learn?

796


What are maps in c++?

711


Is ca high or low level language?

813


What is the role of static keyword for a class member variable?

856


If horse and bird inherit virtual public from animal, do their constructors initialize the animal constructor? If pegasus inherits from both horse and bird, how does it initialize animal’s constructor?

909


Is it legal in c++ to overload operator++ so that it decrements a value in your class?

827


Why do we need pointers?

759


Is c++ an oop?

814


Is recursion allowed in inline functions?

802


Explain the concept of memory leak?

860


Define private, protected and public access control.

834


Explain virtual destructor?

906