struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Page <Bi...@DigitalGarden.com>
Subject RE: Java Trivia
Date Fri, 01 Feb 2002 15:56:58 GMT
yes, but one difference between java and say C++ is that in C++ you can pass
the actual pointer meaning that you can make it point to another instance of
the object in addition to change the internal attributes.  In Java because
the pointer is always passed by value (or perhaps a copy of the pointer if
you like), you can change the internal stuff, but never the instance of the
object.

bp

-----Original Message-----
From: Olivier Dinocourt [mailto:olivier.dinocourt@anpe.fr]
Sent: Friday, February 01, 2002 8:53 AM
To: Struts Users Mailing List
Subject: Re: Java Trivia


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.


--
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