Assessments

Chapter 1, An Introduction to Inheritance and Polymorphism

  1. Objects and classes are the building blocks of a C++ program. By combining data and algorithms (code) into a single unit, the C++ program represents the components of the system that it models, as well as their interactions.
  2. Public inheritance represents an is-a relationship between objects—an object of the derived class can be used as if it was an object of the base class. This relation implies that the interface of the base class, with its invariants and restrictions, is also a valid interface for the derived class.Unlike public inheritance, private inheritance says nothing about the interfaces. It expresses a has-a or is implemented in terms of relationship. The derived ...

Get Hands-On Design Patterns with C++ - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.