Title: [CTJUG Forum] Re: Silly Question about Collections and Pointers

From: Sparky [mailto:[EMAIL PROTECTED]
Sent: 10 March 2006 08:28 AM
To: [EMAIL PROTECTED]
Subject: [CTJUG Forum] Re: Silly Question about Collections and Pointers

 

Michael,

That makes so much sense. Thank you for answering my question.

Please confirm that I gave it correct:

So when  I think I'm destroying the object by setting it to null, I'm
not destroying it at all as there is still a reference to it in the
array. When I create a new object, even though it has the same name,
I'm creating a completely new object, and this object (completely
seperate), too has it's reference stored in the array.

Just so that we’re absolutely clear, I assume you that you’re putting the second object into the array as well. It will only function like this if you do. Just so that we’re absolutely clear, I assume you that you’re putting the second object into the array as well. It will only function like this if you do.

I can then set
the new one to null too, but as long as the pointers are still elements
of the array, the objects will exist. If I set the array to point to
null, then I will lose the pointers to the objects and the GC will then
clean up the whole lot.

Exactly right.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CTJUG Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/CTJUG-Forum
-~----------~----~----~----~------~----~------~--~---
Read our disclaimer at: http://www.picknpay.co.za/pnp/view/pnp/en/page5093?
If you don't have web access, the disclaimer can be mailed to you on request.
Disclaimer requests to be sent to [EMAIL PROTECTED]

Read our disclaimer at: http://www.picknpay.co.za/pnp/view/pnp/en/page5093?
If you don't have web access, the disclaimer can be mailed to you on request.
Disclaimer requests to be sent to [EMAIL PROTECTED]


Reply via email to