public — "is-a". protected — "implemented-as". private — "implemented-in-terms-of".
1class Base {2public:3 int pub;4protected:5 int prot;6private:7 int priv;8};910class Public : public Base {11 // pub — public12 // prot — protected13 // priv — not accessible14};1516class Protected : protected Base {17 // pub — protected18 // prot — protected19};2021class Private : private Base {22 // pub — private23 // prot — private24};