[Logo]
Forums Register Login
Garbage Collection


Can any one tell me whether at the starting of line 2 how many objects are garbage collcted ?
Hi, I think the answer is 9 objects are eligible. every time when the loop encounters the new keyword it creats new object and the same q reference variable is pointing to it. At last we are left with 10 objects and only one reference Variable pointing to 10th Object. Thank you
9
When I was younger I felt like a man trapped inside a woman’s body. Then I was born. My twin is a tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss


This thread has been viewed 593 times.

All times above are in ranch (not your local) time.
The current ranch time is
Jul 21, 2018 15:33:42.