struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Olivier Dinocourt" <olivier.dinoco...@anpe.fr>
Subject Re: Java Trivia
Date Fri, 01 Feb 2002 13:52:54 GMT
yes and no.

the point is not really whether arguments are passed by reference or value.
It is rather whether a chang to the argument inside the method will be
reflected outside. In the case of Objects, it will. In the case of
primitives (including Strings, if I am not wrong), it won't.

olivier (hoping he has not just written bullshit... :)

----- Original Message -----
From: "Galbreath, Mark" <Galbreath@tessco.com>
To: "'Mikkel Bruun'" <mikkel.bruun@valtech.dk>; "Struts (E-mail)"
<struts-user@jakarta.apache.org>
Sent: Friday, February 01, 2002 2:48 PM
Subject: RE: Java Trivia


> Obviously, the first is passed by value, but the second?  We know p will
> reference the same object it referenced before the method invocation - the
> memory location it points to is the same.  Because p will always point to
> the same memory location, is it not also passed by value?
>
> ;-)
>
> -----Original Message-----
> From: Mikkel Bruun [mailto:mikkel.bruun@valtech.dk]
> Sent: Friday, February 01, 2002 8:44 AM
>
>  Ehh...
>
> primitives vs ojbects???
>
> by value or by ref...
>
> whats the point??
>
> -----Original Message-----
> From: Galbreath, Mark
> To: Struts (E-mail); J2ee (E-mail)
>
> What's the difference between
>
> int i = 3;
> someMethod( i);
>
> and
>
> Point p = new Point( 3, 3);
> someOtherMethod( p);
>
> ?
>
> Mark
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message