I'm still working my way through Bruce Eckels Thinking in
Java and have come up with a query about reference objects.
Bruce says:
You use reference objects when you want to continue to hold onto a reference to that object, but you also want to allow the garbage collector to release that object. Thus, you have a way to go on using that object, but if memory exhaustion is imminent, you allow that object to be released. I thought that once the garbage collector releases an object it is gone for good. If the garbage collector releases the object, then the memory that holds the object gets cleared so it can be used again. So how can you keep a reference to an object
and get the garbage collector to release it at the same time?
If the garbage collector releases the memory, what is left for the Reference point to?