Here's a GC-related question from a Whizlabs mock exam simulator for
SCJP:
When the program reaches line X, how many of the
String objects created at line y will be eligible for GC? I'm told to assume that the System.out object is not keeping a reference.
Now the answer is given to be 10, but from what I'm seeing here [probably seeing wrong

], all strings (11 in total) created at line y will be eligible for GC when execution comes to line X. Whizlabs says that 11 is wrong, because even though the tmp variable is out of scope in line X, the local variable still has a reference.
How come?