black

SCJP程序员认证考试

登录

单项选择题

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.

相关考题

多项选择题 Whichtwocauseacompilererror?()

单项选择题 public class Test {  public static void main(String args[]) {  class Foo {  public int i = 3; }  Object o = (Object)new Foo();   Foo foo = (Foo)o;  System.out.println(“i = “ + foo.i); }  }  What is the result?()

单项选择题 Whichinterfacedoesjava.util.Hashableimplement?()

All Rights Reserved 版权所有©财会考试题库(ckkao.com)

备案号:湘ICP备2022003000号-2