Java Arena

Module 36

Polymorphism

One object seen through each of its types, from its own class up to Object and every interface it has. What a variable's type allows, instanceof and casts, and the ClassCastException of a wrong cast, a program built on one general type that works with every kind of object, choosing between extends and an interface, and the end of part 9. MOOC sections 9.3 and 9.4.

Steps

  1. Hierarchies: one object, many types
  2. instanceof and casts
  3. A program built on polymorphism
  4. Choosing a design, and the end of part 9