David Houghton wrote:im i right in saying that although the code 'b1 = null' is executed, it is still accessible as the a2 object still has a reference to b1 because its a static variable?
Correct... Setting b1 (the local variable) to null just removes one reference to the object. It is still accessable via the b1 (static variable) of the alpha class.
David Houghton wrote:Also am i right in thinking that b1 would not be eligible for garbage collection until there is no reference to it, ie if 'a2 = null' was executed?
No. Setting a2 to null, will *not* make the b1 (static variable) object eligible. Even if a2 is equal to null, you can access static variables with it, and not get a null pointer exception.
Henry