Oracle
1Z0-851 · Question #29
1Z0-851 Question #29: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-851 to reveal the answer and full explanation for question #29. The question stem and answer options stay visible for context.
Question
Given: 1. public class GC { 2. private Object o; 3. private void doSomethingElse(Object obj) { o = obj; } 4. public void doSomething() { 5. Object o = new Object(); 6. doSomethingElse(o); 7. o = new Object(); 8. doSomethingElse(null); 9. o = null; 10. } 11.} When the doSomething method is called, after which line does the Object created in line 5 become available for garbage collection?
Options
- ALine 5
- BLine 6
- CLine 7
- DLine 8
- ELine 9
- FLine 10
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.