up previous next contents
Next: Extending Interfaces Up: Interfaces Previous: An example interface   Contents

Single inheritance versus multiple inheritance

  • A new class can extend exactly one superclass.
  • The new class inherits the superclass's (a) contract and (b) implementation.
  • Some languages allow multiple inheritance - two or more superclasses.
  • Problem of multiple inheritance arises from multiple inheritance of implementation. (Usually related to a class that maintains state information.)


up previous next contents
Next: Extending Interfaces Up: Interfaces Previous: An example interface   Contents