derivations
1. Regardless of the type of derivation, private members are inherited by the derived class, but cannot be accessed by the new member function of the derived class, and certainly not by the instances of the derived class.
2. In a private derivation, the derived class inherits public and protected members as private. A new member's function can access these members, but instances of the derived class may not. Also any members of subsequently derived classes may not gain access to these members because of the first rule.
3. In public derivation, the derived class inherits public members as public, and protected as protected. a new member function of the derived class may access the public and protected members of the base class ,but instances of the derived class may access only the public members.
4. In a protected derivation, the derived class inherits public and protected members as protected .a new members function of the derived class may access the public and protected members of the base class, both instances of the derived class may access only the public members.