Computer Science 1037A/B Lecture 5: Inheritance

40 views5 pages

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents