Somewhere in
SCJP it says that calling the System.gc() is just a recommendation to the JVM to clean up some garbage. So, just like threads, my guess is there is no gaurantee that the objects will be garbage collected at all, let alone in any predictable order.
Is this a question on a mock exam?
I get the second output if I do the following:
t1=null;
System.gc();
t2=null; //<-
System.gc();