| Introduction to OOP | Chapter 1: Thinking Object-Oriented : | next | previous | audio | real | text |
var
Fred : Florist;
Elizabeth : Friend;
Ken : Dentist;
begin
Fred.sendFlowersTo(myFriend); { will work }
Elizabeth.sendFlowersTo(myFriend); { will also work }
Ken.sendFlowersTo(myFriend); { will probably not work }
end;
The same message will result in different actions, depending upon who
it is given to.