Computer Science 1037A/B Lecture 5: Inheritance
Document Summary
Think of the literal term of passing on property titles, liabilities form one to the other. One class can inherit the member variables and functions from another class. Example: car and truck inherit their properties from the broader automobile secion. Inheritance is a way of creating a new class by starting with an existing class and adding new members. The new class can either replace or extend the functionality of he existing class. The existing class is called the base class (parent or superclass) and the new class is called the derived class (child or subclass) Base passes on its members to derived. Notice how the base parent only has its own member variables/functions while the derived child has both its own variables and the variables of the parent. Multiple inheritances is when one derived class inherits its variables/functions from more then one base.