The Object is eligible for GC only when there are no references attached to it.
For example
String s1 = new String();
String s2 = s1;
s1 = null;
In this case, the string object is not garbage collected since s2 is referring to it.
So this justifies the answer.