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.
正确答案:E
答案解析:有

微信扫一扫手机做题