[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
Polimorphism The same message applied to different Objects
--------------------------------------------------------------------------------
The same message sent to Objects of different Classes, invokes different
methods.
Supouse we have a ball and a glass. Then I take a hammer and I knock
on them:
My message --> HammerKnock
Object Ball --> start jumping from one place into another.
Object Glass --> Gets destroyed into a lot of small pieces.
Now I have a TReport() Object and a TLabel() Object:
I send them the message :Print()
oReport:Print()
oLabel:Print()
I get different results on my printer!
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson