题库 软件开发 题目列表 下面哪些描述是正确的:(  ) public class Test {...
多选题
下面哪些描述是正确的:(  )
public class Test {
    public static class A {
        private B ref;
        public void setB(B b) {
            ref = b;
        }
    }
    public static Class B {
        private A ref;
        public void setA(A a) {
            ref = a;
        }
    }
    public static void main(String args[]) {
    …
        start();
    ….
    }
    public static void start() { A a = new A();
        B b = new B();
        a.setB(b);
        b = null; //
        a = null;
    …
    }
}

A.

b = null执行后b可以被垃圾回收

B.

a = null执行后b可以被垃圾回收

C.

a = null执行后a可以被垃圾回收

D.

a,b必须在整个程序结束后才能被垃圾回收

E.

类A和类B在设计上有循环引用,会导致内存泄露

F.

a, b 必须在start方法执行完毕才能被垃圾回收

题目信息
校招真题
-
正确率
0
评论
14
点击