Go to Top

Sunday, 24 April 2011

What is a message in Java

                                        In the real world we communicate and interact with other objects to make it work. For example, in order to watch the television, we have to switch it on (interaction) either by remote or by using the buttons on it. In the world of computers, the software components communicate and interact with other objects by sending messages. For example, if an object A wants to run one of the methods of the object B, then it sends a message to the object B. Software objects interact and communicate with each other by sending messages. 

                                        Sometimes, the object receiving the message needs some more information than what is provided to it by the message. For example, to change the channel number or the volume of the television, we have to indicate the channel number or the volume to change to. Such information is passed along with the message as Parameters. And after the work has been done according to the message passed, the program, if correct, will show the desired output. 


No comments:

Post a Comment

ShareThis