Title: Inheritance: Introduction
Course: CPS 161: An Intro to Programming with Java - DL MM MASTER > Section: Learning Units - Bb

Presentations and Videos

- Inheritance: Introduction lecture video (Time: 46:00)
- Inheritance: Introduction document

- Inheritance provides a way to eliminate duplication of code when supporting multiple variations of the same code
- Inheritance provides a way to conveniently make use of Building Blocks of code.
- Inheritance implies an "IS_A" relationship
- Examples: World of Living things(Life/Animals/Mammals/etc.), Game of Chess, Textbook Employee/SalariedEmployee
- Constructing Inherited classes using super(Using the textbook Employee, SalariedEmployee, etc example). Note the house construction model for how this operates.
- Calling methods in the parent class. For example super.toString().
- Note that sometimes the relationship between 2 classes should be "HAS A" instead of "IS A". If you get this wrong, the compiler won't know the difference.