Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
Forums
Register
Login
Certification
»
Programmer Certification (OCPJP)
K&B Self Test Chp3 Q11
Jack Bento
,
Ranch Hand
Feb 15, 2010 07:23:40
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
3. class Beta { } 4. class Alpha { 5. static Beta b1; 6. Beta b2; 7. } 8. public class Tester { 9. public static void main(String[] args) { 10. Beta b1 = new Beta(); Beta b2 = new Beta(); 11. Alpha a1 = new Alpha(); Alpha a2 = new Alpha(); 12. a1.b1 = b1; 13. a1.b2 = b1; 14. a2.b2 = b2; 15. a1 = null; b1 = null; b2 = null; 16. // do stuff 17. } 18. }
When line 16 is reached, how many objects will be eligible for garbage collection?
Is there really only 1 object eligible? I make it the 2 objects b1 & a1
Neha Daga
,
Ranch Hand
Feb 15, 2010 07:29:42
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
this question has already been discussed
here
Jack Bento
,
Ranch Hand
Feb 15, 2010 07:44:18
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
thanks
Post by:
autobot
I found some pretty shells, some sea glass and this lovely tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
This thread has been viewed 979 times.
Similar Threads
Garbage collection program really confusing me?
Eligible for garbage collection
kathy sierra question doubt
Problems with garbage collection
Garbage Collection query.
More...
All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 15:57:55
.