Loading video...
Inheritance
- Inheritance and Composition are two different ways to quickly build multiple classes related to each other
- Inheritance uses an is-a relationship like An eagle is-a bird, or a falcon is-a bird
- Composition uses a has-a relationship like A bird has-a beak, a bird has wings
- Composition will use a main class that calls other classes to build itself
- Inheritance will use the extends keyword to create another class based on the super-class
Inheritance
Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.
- Intro
- Composition vs. Inheritance
- Composition vs. Inheritance
- Inheritance Class Structure
- Method Overriding vs. Overloading
- Inheritance Class Hierarchy
- Protected Members
- Example 1: Basic Inheritance with Constructors
- Example 2: Program Exhibits Both Composition and Inheritance
- Example 3: Class Point Definition
- Example 4: Class Quadrilateral Definition
- Example 5: Class Trapezoid Definition
- Example 6: Class Parallelogram Definition
- Example 7: Class Rectangle Definition
- Example 8: Class Square Definition
- Example 9: Main Application for Shapes Exercise



































Start Learning Now
Our free lessons will get you started (Flash® 10 required).
Sign up for Educator.comGet immediate access to our entire library.
Features Overview