PPT Slide
- Polymorphism means “taking many forms” ... an object of a given class can adapt take the formof any of its subclasses.
- Polymorphism means that the correct move( ) method will always be called.
- A subclass can be substituted for its superclass, e.g., a bird for an animal. “A bird is a animal.” Yes.
- The reverse is not true: can’t substitute superclass for a subclass, e.g.,
CANNOT substitute an animal for a bird.
“An animal is a bird?” No.
- A single interface for multiple behaviors: Only one interface for the method call.
Multiple behaviors based on the subclass.