AFAIK, in object oriented languages, an object itself is never
destroyed setting to null a pointer that refers to it (and it doesn't
get overwritten when assigning that pointer to another instance).
In some OOL (C++) you have to make an explicit call to destroy in
order to free the memory
When you set it to null it removes the reference the current scope or
context, and when you pass it into that function it is in a different
scope from this. had you done this.obj = null, then it would have been
completely de-referenced and eligible for garbage collection.
--- In
When it is said that the object is passed by reference versus passed
by value, what is being implied is that a copy of the object is NOT
being sent, but a reference instead is sent. The reference itself is
STILL contained within a variable scoped to the method (the
parameter). Therefore, nulling
3 matches
Mail list logo