private private inheritance

Private inheritance can be achieved has a relationship, which is included.

Private inheritance:

1. The public and protected members of the parent class into subclasses private members in the subclass, 

    1.1 This means that inherit from the parent class over those members (public / protected), a member of the subclass can call it;

          But the object subclasses will not be able to call it;

    Further understanding is that the subclass can call parent class (public / private) interface, but these interfaces are not exposed to .

This feature just realized features include (composite) of.
----------------
Disclaimer: This article is the original article CSDN bloggers "wowRicky", and follow CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement. .
Original link: https: //blog.csdn.net/wowricky/article/details/24178667

Guess you like

Origin www.cnblogs.com/Stephen-Qin/p/12234641.html