Oracle
1Z0-851 · Question #134
1Z0-851 Question #134: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-851 to reveal the answer and full explanation for question #134. The question stem and answer options stay visible for context.
Question
Given: class Snoochy { Boochy booch; public Snoochy() { booch = new Boochy(this); } } class Boochy { Snoochy snooch; public Boochy(Snoochy s) { snooch = s; } } And the statements: 21. public static void main(String[] args) { 22. Snoochy snoog = new Snoochy(); 23. snoog = null; 24. // more code here 25. } Which statement is true about the objects referenced by snoog, snooch, and booch immediately after line 23 executes?
Options
- ANone of these objects are eligible for garbage collection.
- BOnly the object referenced by booch is eligible for garbage collection.
- COnly the object referenced by snoog is eligible for garbage collection.
- DOnly the object referenced by snooch is eligible for garbage collection.
- EThe objects referenced by snooch and booch are eligible for garbage collection.
Unlock 1Z0-851 to see the answer
You've previewed enough free 1Z0-851 questions. Unlock 1Z0-851 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.