This week's book giveaway is in the Agile and Other Processes forum. We're giving away four copies of Darcy DeClute's Scrum Master Certification Guide: The Definitive Resource for Passing the CSM and PSM Exams and have Darcy DeClute on-line! See this thread for details.
I guess you are mistaken here that c1 is pointed to c.......Well 1 thing about java is that its pass by copy. So bitpattern used to get to the object it refers is passed not the object. and when c1 = c3 and c2 = c3 happens means c1 and c2 is used to refer the object which is referred by c3. Now the objects referred by c1 and c2 are eligible for GC. The reference z inside the objects are reference variables which reside in the heap and thus cannot be used from the outside world or from a live thread.
gc questions use pen and paper to solve.
[ SCJP 6.0 - 90% ] , JSP, Servlets and Learning EJB.
Try out the programs using a TextEditor. Textpad - Java 6 api