Hi Manoj,
Good, you got the Corey's blog.
But unfortunately you missed the vital part of GC.
First of all, objects live on the heap and GC applies to only heap.
Reference variables live on the stack so there is nothing like GC on them.
You simply look at the "new" Operator. How many objects created using "new".
Yes exactly two. So we will work to find out how many reference variables still point to those two objects when you reach to the last line of the method.
You spotted well, only Cat object feels lonely because there is nobody to
reference it.
Finally:
"GC applies to objects not reference variable."
Regards,
cmbhatt