Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Inheritance: -way to re-use code in object oriented programming -establishes sub-types of objects

superclass: subclasses:

BHSECStudent HighSchoolStudent EarlyCollegeStudent

superclass: subsclasses: Circle

Shape Square Triangle

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.

You might also like