请教一道SCJP的题目,关于垃圾回收的,请各位前辈多多指教
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
F. 6
答案是 C
可小弟我认为是E,理由是除了2个lcelandic需回收外,2个lcelandic中继承到的Long weight需要要回收,故应该4个呀
请各位老师指导!