The final keyword can be used directly in 1.C11 so that the class cannot be inherited
2. The derived class initializes the base class part by calling the constructor of the base class, and if the base class constructor is declared private, the link error occurs when the derived class member is instantiated, but such a base class cannot be instantiated, and the compilation error
3. The constructor of a class is declared private, and the class and its subclasses cannot be instantiated, but if the handle class is declared as a friend of the class, the subclass can call the private member function of the base class, that is, the subclass can be instantiated at this time, and subclasses of subclasses can also be initialized. Because subclasses of subclasses initialize the base class part of the constructor of the calling subclass, and the subclass is normal initialization, so think of virtual inheritance, subclass virtual inheritance from the parent class, subclasses of subclass normal inheritance from the child class, at this time the subclass and subclass subclass a pointer, the pointer to the base class part.
class a{private: A () {} class B;}; class Virtual a{}; class Public b{}; void Main () { b b; // OK c C; // false}
A class is designed in C + + so that it cannot inherit