The variable o is a reference to an object. The list has another reference to the same object. When you set o to null or let it go out of scope, the list still has its reference, so the object cannot be garbage collected yet. Did that answer the right question?
BTW: Does that compile? If not, can you fix it?
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
posted 12 years ago
I don't know if it compiles, it was just "air code" to convey my question. Yes that answers my question, thanks. I didn't think it through enough before I posted. I was getting confused between setting an object reference to null and setting the value of the object to null. The answer is obvious now, Thanks.