What is the difference between method and message?
Answers were Sorted based on User's Feedback
Answer / smita
Message:
Objects communicate by sending messages to each other. A
message is sent to invoke a method.
Method:
Provides response to a message. It is an implementation of
an operation.
| Is This Answer Correct ? | 129 Yes | 17 No |
Answer / dd
Method is a function or procedure that is defined for a
class and typically can access the internal state of an
object of that class to perform some operation. While
message is refer to instruction that is send to object which
will invoke the related method.
| Is This Answer Correct ? | 61 Yes | 6 No |
Answer / scott
A message is any packet of communication between objects.
The objects may be in the same program, or they may be on
different systems. It simply doesn't matter.
A method is a block of code attached to an object by some
means. It may be implicitly attached by means of a class,
or it may be an anonymous closure attached to an arbitrary
attribute of the object.
| Is This Answer Correct ? | 18 Yes | 4 No |
Answer / rajputvishal
A message is an instruction to perform some operation send by an object to another object which will perform the operation.
A method is the implementation which is executed after receiving the message
| Is This Answer Correct ? | 14 Yes | 3 No |
Answer / earvinyuvi
Message:
Objects communicate by sending messages to each other. A
message is sent to invoke a method.
Method:
Provides response to a message. It is an implementation of
an operation.
| Is This Answer Correct ? | 6 Yes | 2 No |
Define 'std'.
Write a program to add three numbers in C++ utilizing classes.
In a class, there is a reference or pointer of an object of another class embedded, and the memory is either allocated or assigned to the new object created for this class. In the constructor, parameters are passed to initialize the data members and the embedded object reference to get inialized. What measures or design change should be advised for proper destruction and avioding memory leaks, getting pointers dangling for the embedded object memory allocation? Please suggest.
Given the following function definition: int doit(int &x, int y, int &z) { x = 3*x; y = y + 5; z = x+y; return z - 4; } int a = 5, b = 7, c = 9, d = 11; d = doit(a,b,c);
Explain abstraction.
How to construct muliton object
What is the difference between a baller and a reference in C++?
What's the hardest coding language?
What are c++ data types?
print first nodd numbers in descending order
What will happen if a pointer is deleted twice?
What is a multiset c++?