Protected Inheritance Assignment Help

Assignment Help: >> Inheritance - Protected Inheritance

Protected Inheritance

Within a protected inheritance,

  • Every public member in the base class is protected in the derived class.
  • Every protected member in the base class is protected in the derived class
  • Every private member in the base class remains private in the base class and therefore it is visible only in the base class.

For eg,

Class baseA

{

public:

};

private:

int x;

protected:

int y;

int z;

class derivedD:protected baseA

{

private:

int w;

};

A class derivedD is derived from the base class baseA and the access specifier is protected. A data members of the derived class derivedD is int x,y,z,w;

The given table displays the access specifier of the data member of the base class in

269_protected inheritance.png

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd