Dynamic binding
Allow subclass to be used wherever a superclass is expected
Allows reuse of superclass’ code
When message is sent, proper operation is located and invoked
r:Rectangle := …
cr:ColorRectangle := …
r := cr;
…
r.draw();
which draw is invoked?
Previous slide
Next slide
Back to first slide
View graphic version