- Feb 8, 2004
- 12,604
- 15
- 81
Just to clarify if i run this it creates 20 objects and 19 of them are garbage collected because only the final one has a reference yeah?
If that's true then are Thread objects special in some way? What prevents a Thread from being garbage collected when it has no reference?
Code:
for (int count = 0; count <20; count ++)
{
MyObject jerry = new MyObject();
}
If that's true then are Thread objects special in some way? What prevents a Thread from being garbage collected when it has no reference?
