题库 软件开发 题目列表 main程序输出: class Test {     private static...
单选题
main程序输出:
class Test {
    private static Test t = null;
    int i;
    private Test() {
        i = 90;
    }
    public static Test getInstance() {
        if (t == null) {
            t = new Test();
        }
        return t;
    }
    public static void main(String[] args) {
        Test t1 = Test.getInstance();
        System.out.println(t1.i);
        t1.i = t1.i + 20;
        Test t2 = Test.getInstance();
        System.out.println(t1.i);
    }
}

A.
0

90
B.
0

110
C.
90

90
D.
90

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