please help me to solve this question!# Java - 爪哇娇娃
b*n
1 楼
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;
...
My answer: only one object exists after the code executes. point object is
eligible for garbage collection.
Is my answer right?
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;
...
My answer: only one object exists after the code executes. point object is
eligible for garbage collection.
Is my answer right?