|Introduction to OOP||Chapter 11: Static and Dynamic Behavior:||next||previous||audio||real||text|
Polymorphism says we can assign a value from a child class to an instance of the parent class, but can this assignment then be reversed? Under what conditions?
var pet : Mammal; fido : Dog; felice : Cat; begin pet := fido; // legal fido := pet; // is this legal? end;