Ditai C++ Study Notes-Lesson 45-Different Ways of Inheritance

C++ supports three different inheritance methods, and only public inheritance methods are used in the project
(1) public inheritance: members of the parent class maintain the original access level in the child class
(2) private inheritance: members of the parent class become in the child class Private members
(3) protected inheritance: common members in the parent class become protected members, and other members remain unchanged

Guess you like

Origin blog.csdn.net/cj532419842/article/details/115194163