QUESTION 36
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?
A. None of these objects are eligible for garbage collection.
B. Only the object referenced by booch is eligible for garbage collection.
C. Only the object referenced by snoog is eligible for garbage collection.
D. Only the object referenced by snooch is eligible for garbage collection.
E. The objects referenced by snooch and booch are eligible for garbage collection.
Solution : E
'자격증 > OCJP_ExamB' 카테고리의 다른 글
QUESTION 39 (0) | 2018.07.11 |
---|---|
QUESTION 38 (0) | 2018.07.11 |
QUESTION 35 (0) | 2018.07.10 |
QUESTION 34 (0) | 2018.07.10 |
QUESTION 32 (0) | 2018.07.10 |
#IT #먹방 #전자기기 #일상
#개발 #일상