Re: Can a class accept a message?
- From: Mark Space <markspace@xxxxxxxxxxxxxx>
- Date: Mon, 28 Apr 2008 18:12:02 -0700
tenxian wrote:
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.)
.
- References:
- Can a class accept a message?
- From: tenxian
- Can a class accept a message?
- Prev by Date: Re: Newbie question on classes , methods
- Next by Date: Cheap Accutron Watches Excursion Watches - Accutron Watches Excursion Watch Cheapest
- Previous by thread: Re: Can a class accept a message?
- Next by thread: Re: Can a class accept a message?
- Index(es):
Relevant Pages
|