欢迎来到PP题库网 PP题库官网
logo
全部科目 > Java认证考试 > SCJP程序员认证考试

多项选择题

1. class TestA { 
2. TestB b; 
3. TestA() { 
4. b = new TestB(this); 
5. } 
6. } 
7. class TestB { 
8. TestA a; 
9. TestB(TestA a) { 
10. this.a = a; 
11. } 
12. } 
13. class TestAll { 
14. public static void main (String args[]) { 
15. new TestAll().makeThings();
16. // ...code continues on 
17. } 
18. void makeThings() { 
19. TestA test = new TestA();
20. } 
21. } 
Which two statements are true after line 15, before main completes?()

    A. Line 15 causes a stack overflow.
    B. An exception is thrown at runtime.
    C. The object referenced by a is eligible for garbage collection.
    D. The object referenced by b is eligible for garbage collection.
    E. The object referenced by a is not eligible for garbage collection.
    F. The object referenced by b is not eligible for garbage collection.

点击查看答案&解析

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题