3 ms·
That may be because there are several forms of polymorphism. What you had in mind was subtype polymorphism (aka substitution), while he might have had another f
by jpatte 14y ago
That may be because there are several forms of polymorphism. What you had in mind was subtype polymorphism (aka substitution), while he might have had another form in mind like parametric polymorphism (aka generics). http://en.wikipedia.org/wiki/Polymorphism_(computer_science) http://en.wikipedia.org/wiki/Polymorphism_(computer_science)
Btw I assume you meant "calling derived member methods through pointers to base classes" instead.
- Luyt 14y agoYes, you are correct. I meant something like: animal->move_random(), where animal can be a dog, cat, or even a bird (with an extra z coordinate ;-).