9 Polymorphism

Dynamic dispatch: definition of method-call, Subtyping

Learning Outcomes

  1. Enable polymorphism by overriding methods

  2. Write final classes and methods

  3. Utilize polymorphism to cast and call methods, differentiating object type versus reference type

  4. Distinguish overloading, overriding, and hiding


Exam Topics

  • Utilize polymorphism and casting to call methods, differentiate object type versus reference type

  • Use primitives and wrapper classes, including, operators, parentheses, type promotion and casting

Oracle Academy

  • No Oracle Academy this week

Textbook

  • 10 Object-Oriented Programming: Polymorphism (10.1-10.4)

  • 10 Object-Oriented Programming: Polymorphism (10.5-10.8)

Tutorial / Practice Activity

  • Dynamic dispatch Practice

Lesson Plan

  • Mindfulness

  • Previous week review

  • Resource reinforcement and clarification

  • Final classes and methods

  • Contexts in which a subtype is usable when a supertype is expected.

  • The relationship between object-oriented inheritance (code-sharing and overriding) and subtyping (the idea of a subtype being usable in a context that expects the supertype).

  • Project

Mindfulness