This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
In line1, we are doing is that, just giving a new refenrce, z, to the object referred by y. so both y and z are pointing to the same object. In line2, we are assigning the refernce, z to null. ie, only changing the refernce, z. Still, y is pointing to the object. So, this won't be available for garbage collection. So the answer will be right.
I have changed the code a little bit. When you set yy to null, it has no effect on y. So y refers to the integer object with value 99 and x refers to integer object with value 10 when the statement in question is reached.