[EMAIL PROTECTED] wrote:
> 
> On Wed, 13 Oct 1999, Robert Simmons wrote:
> 
> > Since everything in java is passed by reference this becomes even more of an issue.
> > Therefore can I do the following to achieve the desired safety ?
> 
> Well, everything is not passed by reference in Java.  I believe primitives
> and immutable types are passed by value.  Someone know the exact rules
> behind this? 

Everything is passed by value. 
But you never actually pass objects, you only ever pass references to
objects.

Making a parameter final means you can't change what object that
parameter refers to. (you can still make changes to the object, if it's
not immutable)

Once you understand that its pretty clear what's happening.

Regards
Gordon


Gordon Keith
Programmer
Marine Science Support
Australian Antarctic Divsion
http://www.antdiv.gov.au


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

Reply via email to