Box mybox = new Box();
in your example mybox is not object, it is reference of the object which is created by (new Box();)
means mybox is holding bits internally which point to the object,
and gc is the process of cleaning the object from memory which are not used longer,
e.g.
String s1 ="Abc"
s1 = "xyz;
after line 2 the object which is created internally as new String("Abc")
will not have any live reference so it will available for garbage collection, because s1 is now holding the object new String("xyz")