> Java's parameters are copies.  For objects, the value passed happens to be
> a pointer, so you can change the fields within the object to which the
> value points.

Yes, but again, we are "passing the object by reference". The reference is
of course passed by value - since, as I said, there is always *something*
being passed by value.

My point is that the only distinction necessary is that primitives are
passed by values and objects by reference. That the reference to the object
is passed by value is hardly what one would want to know when asking "Are
objects passed by reference?" Hence, the answer to the question should be
"yes".

If someone asked "Are parameters in Java passed by value?", I would  say
no for objects,  since   the person asking is more than likely asking
about the object - not the reference. You might say that  the parameter is
the reference, but that brings  us  back to my original point.

> I quoted the Java Language Spec.  Where is your information coming from?

Nowhere. I am applying simple logic and common sense to the use of
semantics, that's all. I am not debating how objects and references to them
are passed in Java.

> > (my argument does not apply of course if you have in the context of the 
> > statement explicitly qualified "argument" as being the reference to an object)
> 
> Huh?

If you explicitly state that you are talking about the reference to an
object, they are of course passed by value.

-- 
/ Peter Schuller, InfiDyne Technologies HB

PGP userID: 0x5584BD98 or 'Peter Schuller <[EMAIL PROTECTED]>'
Key retrival: Send an E-Mail to [EMAIL PROTECTED]
E-Mail: [EMAIL PROTECTED] Web: http://scode.infidyne.com


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to