Professional Documents
Culture Documents
12/15/2011 CS Inheritance Notes
12/15/2011 CS Inheritance Notes
superclass: subclasses:
Subclass: borrows behavior (methods and data) from its parent superclass Superclass: Gives behavior (methods and data) to its child subclass In Python: class Shape: <methods & data> class Triangle(Shape) <methods & data> #all methods and data from Shape class are part of the Triangle class; they are inherited from #the parent Look at example of area method in Shape project code, and describe how the area function in the Shape class serves as a promise that an area function will be implemented in each child subclass.