Lecture 2

Inheritance & Polymorphism

Learning Outcomes

At the end of this lecture, you’ll be able to:

Lecture Plan

In this lecture, we'll cover the following lessons:

  1. The GradStudent class: Code duplication is undesirable!
  2. The GradStudent class: Code reuse through Inheritance
  3. The GradStudent class: Inheritance syntax in Java
  4. Inheritance: The nuances!
  5. Inheritance: Symmetric relationship?
  6. Java Interlude: Selective inheritance?
  7. Inheritance: Transitive relationship?
  8. Java Interlude: Multiple inheritance?
  9. Inheritance: Type hierarchy
  10. Inheritance: Type substitution
  11. Type hierarchy: Casting of types
  12. Type hierarchy: Apparent vs. Actual Type
  13. Polymorphism: Static or compile-time
  14. Polymorphism: Dynamic or runtime
  15. Polymorphism: Exercise
  16. Java Interlude: Method Overriding
  17. Inheritance: Is-a relationship
  18. Java Interlude: The Object class

Lessons marked with ⚡ contain exercise/activity.

Downloads