how many objects are eligible for garbage collection when end line of main is reached?
<p>My main problem is how many object is really created at executing the line</p>

<pre><code>Dozens [] da = new Dozens[3];
</code></pre>

<p>And how many object will be eligible for garbage collection at the end of main function</p>

<pre><code>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;
    // do stuff
  }
}
</code></pre>
