I want a confirmation.
Daniel Pitts - 29 Apr 2008 01:28 GMT
> I want a confirmation.
That is a very vague question. So the answer is Yes.
public class Message {
}
public class MessageAcceptor {
public static void accept(Message message) {
System.out.println("I accept the message " + message);
}
}
So, what are you really asking?

Signature
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
Mark Space - 29 Apr 2008 02:12 GMT
> I want a confirmation.
This kind of statement comes across as bit rude. Please use a less
demanding tone.
In Java, classes can accept messages, for reasonable definitions of the
word "message".
String.getClass().getName();
sends the message "getName" to the class object for String. One could
also call static methods a message that a class will accept.
Normally however, it's an object that takes the message.
String s = "Hello World\n";
s = s.trim();
sends the message "trim" to the String object "s".
(In object oriented design that I'm familiar with, a "message" is
normally implemented with a method. Other forms of dispatch might
exist, although I can't think of any off the top of my head.)
Roedy Green - 29 Apr 2008 02:21 GMT
On Mon, 28 Apr 2008 17:22:50 -0700 (PDT), tenxian
<hi.steven.tu@gmail.com> wrote, quoted or indirectly quoted someone
who said :
>I want a confirmation.
I presume you mean this is the Smalltalk sense.
Of course. All it means is can your execute a method on an object
with parameters.

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com