Forums Register Login

Garbage Collection

+Pie Number of slices to send: Send


Can any one tell me whether at the starting of line 2 how many objects are garbage collcted ?
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
9
Anderson gave himself the promotion. So I gave myself this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 716 times.
Similar Threads
gc question
garbage collection
About GC (Dan's Mock)
Garbage collection dan's question
doubt about garbage collection
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 03:21:23.