阿摩線上測驗 登入

試題詳解

試卷:104年 - SCJP 51-100#99391 | 科目:OJCP(SCJP)

試卷資訊

試卷名稱:104年 - SCJP 51-100#99391

年份:104年

科目:OJCP(SCJP)

99. Given: 
3. interface Animal{void makeNoise();} 
4. class Horse implements Animal{ 
5. Long weight = 1200L;
 6. public void makeNoise(){System.out.println("whinny");} 
7. } 
8. public class lcelandic extends Horse{
 9. public void makeNoise(){System.out.println("vinny");} 
10. public static void main(String[] args) { 
11. Icelandic i1 = new lcelandic(); 
12. Icelandic i2 = new lcelandic(); 
13. Icelandic i3 = new lcelandic(); 
14. i3 = i1; i1 = i2; i2 = null; i3 = i1; 
15. } 
16. }
 When line 14 is reached, how many objects are eligible for the garbage collector?
(A) 0
(B) 1
(C) 2
(D) 3
(E) 4
正確答案:登入後查看