Messages, Methods, and Object Interaction
Messages, Methods, and Object Interaction.
In a pure object-oriented programming model, objects interact by sending messages to each other. When an object receives a message, the object invokes a method to process the message. The methodmay change the state of the object, return information contained in the object, or cause objects to be created or deleted.
The object model used by Java is consistent with the concept of message passing, but does not emphasize it.
In the Java model, objects interact by invoking each other's methods. Methods provide access to the information contained in an object. The type of access varies depending on the method.