The following is a question from "learning
Java tutorial" on sun.com:
Question 2: The following code creates one Point object and one Rectangle object. How many references to those objects exist after the code executes? Is either object eligible for garbage collection?
...
Point point = new Point(2,4);
Rectangle rectangle = new Rectangle(point, 20, 20);
point = null;
...
Answer 2: There is one reference to the Point object and one to the Rectangle object. Neither object is eligible for garbage collection.
My question...How can this be?! I thought since point is set to null, there is no longer a reference to Point object!!!
(Can see full question with this link)