可学答题网 > 问答 > SCJP程序员认证考试题库
目录: 标题| 题干| 答案| 搜索| 相关
问题

1. class Test { 


1. class Test {  2. private Demo d;  3. void start() {  4. d = new Demo();  5. this.takeDemo(d); 6. }  7.   8. void takeDemo(Demo demo) {  9. demo = null;  10. demo = new Demo(); 11. }  12. }  When is the Demo object, created on line 3, eligible for garbage collection?()  

  • A After line 5.
  • B After line 9.
  • C After the start() method completes.
  • D When the takeDemo() method completes.
  • E When the instance running this code is made eligible for garbage collection.
参考答案
参考解析:
分类:SCJP程序员认证考试题库
相关推荐

1、1.public class Test {&

1.public class Test { 2.public static void main (String args[]) { 3.class Foo { 4.public&ensp...

2、现有:  class  Test4&ensp

现有: class  Test4  { public static void main (String  []  args)  {  &en...

3、现有:  class Test2 &ensp

现有: class Test2  f public static void main (String  []  args)  {   &en...

4、1.public class test (&

1.public class test ( 2.public static void main (String args[])    { 3.int  i&ensp...

5、11. public class Test&

11. public class Test { 12. public void foo() { 13. assert false; 14. assert false;&en...

6、1. public class Test&e

1. public class Test { 2. int x= 12; 3. public void method(int x) { 4. x+=x;&ensp...