October 1997
Intermediate to advanced
800 pages
20h 48m
English
Inheritance is a powerful language feature and a primary characteristic of an object-oriented language. This chapter explores what inheritance is, how it helps programmers organize classes that more accurately reflect the real world, and how inheritance encourages code reuse and consistent design strategies.
Bundled with inheritance comes polymorphism, the ability to use objects consistently and correctly without knowing their exact type at compile time. This chapter presents virtual functions and dynamic binding, the C++ language features that implement polymorphism. We discuss abstract base classes as they relate to program design and demonstrate how virtual constructors build objects whose type is not known until run ...