C++: inheritance relationship and subclass parent class

Composition: Combining existing objects into an object

Inheritance : making a new class out of a class (abstract)

 

interface: interface (refers to the part of this class that is exposed to the outside world)

Be sure to initialize after the constructor, note: not assignment!

 

Things that are private to the parent class exist in the subclass, but cannot be touched

Protected: allows subclasses to operate, others cannot operate, through which they can access the parent class private

good habits:

     When writing a class, when writing public, first write the constructor, then write the destructor, and then initialize after the constructor

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325652198&siteId=291194637