class A
{
public:
int x;
protected:
int y;
private:
int z;
};
class B : public A
{
// x is public
// y is protected
// z is not accessible from B
};
class C : protected A
{
// x is protected
// y is protected
// z is not accessible from C
};
class D : private A
{
// x is private
// y is private
// z is not accessible from D
};
Note that x,y and z exists in all subclasses but are not accessible in all cases.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.