inheritance, a.k.a. subclassing two is-a's and a has-a is-a (instance of) describes instance-class relationship e.g. Martin is an instance of human being e.g. ticketingQ is an instance of CarQueue is-a (kind of) describes class-class relationship e.g. professor is a kind of human being e.g. ColorPoint is a kind of Point has-a (contains) describes class-instance relationship e.g. human being has a brain (usually) e.g. FerrySim has a CarQueue (two, in fact) We know how to express "is-a instance of" and "has-a" in C++, but not "is-a" kind of yet. Our feature language feature is "inheritance" or "subclassing". ways of thinking about inheritance An instance of a derived class is/has everything that an instance of its base clase is/has and more.* *caveat: If a var. or method is private in the base class, it cannot be referenced in the derived class. A subclass describes a specialization of its superclass. levels of hiding/protection public can be referenced by any code (client, implementation, etc.) protected can be referenced by implementation of this class and derived classes private can *only* be referenced by implementation of this class initializer list means of initializing private member variables of base class method overriding derived class defines method with same name and parameter types (number, type and order) as method in base class overriding overriding using :: (class scope operator) not the same as overloading, which is independent of inheritance examples Point, ColorPoint (Slide Set Q) contrived, self-documenting example: Base and Derived other remarks... What have we learned? Use the debugger and asserts when coding with pointers. Successful compilation is half the battle. Syntax errors are inexcusable. Think more, code less. Read instructions carefully!