J
Juan Gabriel Del Cid
I need to be able to keep a list of object references, and
Well, it's really not that dangerous so much as it is completely useless.
When your variable (nullMe in your example) goes out of scope, it
automatically ceases to exist. As part of it's non-existance, it doesn't
reference your object anymore. This also means that you CANNOT null it
out... it's already gone!
Why exactly do you need to null references out anyway?
-JG
null them out one by one at a later point in time. I realize
this can be dangerous, but I have my reasons.
Well, it's really not that dangerous so much as it is completely useless.
I can't figure out, however, how to keep what is essentially
a reference to a reference. I want to store my objects in an
ArrayList, then loop through the array list and null out the
original reference I was given when I added it to my Array List.
[SNIP]
How do I accomplish this?
When your variable (nullMe in your example) goes out of scope, it
automatically ceases to exist. As part of it's non-existance, it doesn't
reference your object anymore. This also means that you CANNOT null it
out... it's already gone!
Why exactly do you need to null references out anyway?
-JG