<<< Encapsulation     Index     Encapsulation + inheritance + polymorphism >>>

5. Inheritance


  • Consider class hierarchy:

      class hierarchy.quit

  • Finally:

    
    class Printer;
    
    class LazerPrinter;
    
    class InkjetPrinter;
    
    class FaxMachine;
    
    
    void print( Printer* pr )
    {
        pr->print( /*params*/ );
    }
    
    

<<< Encapsulation     Index     Encapsulation + inheritance + polymorphism >>>