Hi ranchers,
how many objects are eligible for garbage collection at the comment here?
In those case of questions I use a simple trick. I always say to myself (twice):
Only
objects are eligible to garbage collection.
Variables never.
OK?
But in this question...
... I'm not really sure if your answers are right. If a method ends, all local variables are eligible to GC, and the constructor is at the end at //here.
x and y are no member variables. So both the tenner and the ninety niner object should be doomed.
But I'm not sure about this. As this would be a different question, I started a
seperate thread about this.
Yours,
Bu.