I have a question on eligibility of garbage collection for this piece of code.
public static void main(String[] args) {
Object a = new Object();
Object b = new Object();
Object c = new Object();
a = b;
b = c;
c = null;
}
I've read through a couple examples of Java garbage collection and I think I'm getting the hang of it. So what I was thinking is that after the line c = null; only c will be eligible for garbage collection because it's the only object that has discarded all references to it. Am I right here?
Thanks!

cfixed it - Markbnow. The only object eligible isObject a = new Object(). That object was dereferenced as soon as you reassignedawitha = b. - Codebender