Oracle
1Z0-809 · Question #132
1Z0-809 Question #132: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-809 to reveal the answer and full explanation for question #132. The question stem and answer options stay visible for context.
Question
Given the code fragment:
class Student {
String name;
int age;
}
And,
public class Test {
public static void main(String[] args) {
Student s1 = new Student();
Student s2 = new Student();
Student s3 = new Student();
s1 = s2;
s3 = s1;
s2 = null;
}
}
Which statement is true?
Options
- AAfter line 11, one object is eligible for garbage collection.
- BAfter line 11, two object are eligible for garbage collection.
- CAfter line 11, none of the objects are eligible for garbage collection.
- DAfter line 11, three objects are eligible for garbage collection.
Unlock 1Z0-809 to see the answer
You've previewed enough free 1Z0-809 questions. Unlock 1Z0-809 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.