class Base
{
private:
int priA;
public:
int pubA;
protected:
int protA
};
class Derived: private Base /// it is Dertived has-a Base
{
public:
};
this means its make all public member and protected member of Base class become private in derived class .so they can not visible outside of the derived class.thats the basic difference.
class base
{
private :
int PriA;
public:
int pubA;
protected:
int proA;
};
class Derived: Protected
{
}
{
private:
int priA;
public:
int pubA;
protected:
int protA
};
class Derived: private Base /// it is Dertived has-a Base
{
public:
};
this means its make all public member and protected member of Base class become private in derived class .so they can not visible outside of the derived class.thats the basic difference.
class base
{
private :
int PriA;
public:
int pubA;
protected:
int proA;
};
class Derived: Protected
{
}
pubic and protecated members of the base class will become protected in derived class.
Comments
Post a Comment