PRIVATE | PUBLIC | PROTECTED |
---|---|---|
Private members of the base class are inaccessible to the derived class. | Private members of the base class are inaccessible to the derived class. | Private members of the base class are inaccessible to the derived class. |
Protected members of the base class become private members of the derived class. | Protected members of the base class become protected members of the derived class | |
Public members of the base class become private members of the derived class. | Public members of the base class become public members of the derived class. | Public members of the base class become protected members of the derived class. |
class base class{
};
class derived class:access label baseclass{
} ;
class square{ .... .... .... } class area:public square{ ..... ..... ..... } class perimeter:public square { ..... ..... ..... }