- The private member of the base class is not visible after it is inherited (highest priority)
- Public inheritance does not change base class member properties
- Protect inheritance (private inheritance) change a base class member to a protected member (Private member)
public.
Protected protected
Private privately owned
When modifying a class member
1. The role of protected and private is the same when no inheritance is involved
2. The role is the same as public when it comes to inheritance
When modifying the inheritance mode
1. Public inheritance class A:public B
Public inherits the public member of the parent class to the child class's public
Inherits the protected member of the parent class to the protected of the child class
The private member of the parent class inherits to the invisible location of the child class
2 Protection inheriting class a:protected B;
3 Private inheritance
C + + Public,protected,private