三种类型的继承,父类的成员均被子类继承(之前的百科关于这点的描述是错误的),只是由类实例化的对象对其继承的成员的访问权限会有所变化。三种不同方式的继承,描述的是子类实例化对象对其成员的访问权限,并非是描述子类时,子类对继承自父类的成员的访问权限。
公有继承 继承自父类的成员保持不变。
私有继承 继承自父类的成员全部变为私有成员。
保护继承 继承自父类的公有成员变为保护成员,其余不变。