There is this question in chapter 3 of scjp 6 study guide book
The question is:
which are true about objects created in the main() and eligible for Garbage Collection:
class Dozens{
int[] dz={1,2,3,4,5,6,7,8,9,10,11,12};
}
public class Eggs{
public static void main(String[] args){
Dozens[] da= new Dozens[3];
da[0]=new Dozens();
Dozens d=new Dozens();
da[1]=d;
d=null;
da[1]=null;
//line 14
}
}
In the book the answers are five objects are created and this i understand and the other answer is two objects are eligible for the GC
In the explanation it says the two objects are da[1] and it array which is dz.
what i don't understand is why isn't Object 'd' included in the GC because i see it referenced to null