Is message passing taking place when calling a function with no input?
i.e. with: object.toString();
Am I passing a message to 'object'?
This might vary between languages, but I'm specifically referring to Java.
Is message passing taking place when calling a function with no input?
i.e. with: object.toString();
Am I passing a message to 'object'?
This might vary between languages, but I'm specifically referring to Java.
Yes. Message passing refers to the communication between the objects so any method call is message passing.
yes and no ... message passing is a model ... the only languages i personally know, that actually employ these semantics are Smalltalk and Objective-C ... so yes, in the sense that object.method()
is as much message passing as object.method(param_1,param_2,...param_n)
... and no, because object.method(param_1,param_2,...param_n)
means:
method
in object
object
as well as param_1,...,param_n
to itthis absolutely captures the semantics of message passing, but in the end, this is simple function invocation as you know it from procedural programming ... the number of parameters neither changes the semantics of the model, nor the implementation ... the parameter list for the actual call simply contains only object
...