Fig 1.7 Polymorphism & Dynamic binding
1.3.9
Message Communication
Normally an object–oriented program contains a set of objects which can
communicate with each other. The steps involved in writing an object–oriented
program are:
h
creating classes
h
creating objects from the classes defined and
h
Establishing communication between objects.
Objects communicate with each other by sending and receiving messages. A
message in nothing but execution of a procedure. Message communication
involves specifying the name of the object, name of the function and the
information to be sent. For example the message.
stack1.push (1);
means stack1 is an object of class stack, push is the function and 1 is the
information.
Do'stlaringiz bilan baham: |