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

Answer Posted / vivek kumar kaushal

Public: this is member function of its own and anyother
class.
Private: Class member access within its class.
Protected:this is member function to its own and derived
class.

Is This Answer Correct ?    34 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What c++ is used for?

583


Explain static and dynamic memory allocation with an example each.

646


What is polymorphism in c++? Explain with an example?

607


Differentiate between declaration and definition.

587


What are references in c++? What is a local reference?

576






Describe exception handling concept with an example?

560


Why pointer is used in c++?

616


Is c++ free?

581


What is c++ and its uses?

624


What is the use of structure in c++?

553


What are the advantages of c++ over c?

584


What are stacks? Give an example where they are useful.

594


What return value must conversion operators have in their declaration?

617


List the advantages of inheritance.

645


Can I have a reference as a data member of a class? If yes, then how do I initialise it?

706