正常
Inheritance and Polymorphism
The power of object-oriented programming lies in "manipulating objects of different types through a unified interface"—and the core mechanisms that make this possible are inheritance and polymorphism. In this chapter we first establish a design judgment—inheritance or composition, and when to reach for each—then start from single-inheritance syntax, figure out what the virtual function table actually is, and see how pure virtual functions and abstract classes let us design interfaces. From there we look at the complexity that multiple inheritance and virtual inheritance bring in, and finally tie the whole OOP design approach together through a hands-on case study.