IMHO the mechanism JAVA uses involves reference counting:
only a reference is passed to the method, so the methods are invoked on same
object.
But if you try to assign the reference smth, reference counting is used: new
object
is created, (or reference count of the other object is increased)
and the old object's reference count is decreased by one.
When reference count is zero, garbage collector has green light on freeing the
space
the object occupied

This technique was adopted in some class's implementation in C++

Andriux

Milt Epstein wrote:

> On Fri, 13 Aug 1999, Thor Heinrichs-Wolpert wrote:
>
> > It is finalized ... Chris is right.
> > You can look at the source to classes like String to confirm it for
> > yourself, or just read part of the tutorials, docs, specs etc at Sun.
>
> Actually, he wasn't, as I explained in a post I just sent out.
>
> In summary, the way Java passes parameters for Objects does allow you
> to change their value indicrectly, using the methods of the Object,
> but it is not strictly using pass-by-reference.
>
> > > I am really confused now about this messages. I think somebody
> > > (not me) should clarify this problem .  I think Chris is right.
>
> Milt Epstein
> Research Programmer
> Software/Systems Development Group
> Computing and Communications Services Office (CCSO)
> University of Illinois at Urbana-Champaign (UIUC)
> [EMAIL PROTECTED]
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

--
Andrius Juozapaitis
Programmer, No Magic
Kaunas, Lithuania
Cell: +370-8534598
WWW: http://www.nomagic.com

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to