题库 软件开发 题目列表 给出如下代码: public abstract class Mother {   p...
单选题
给出如下代码:
public abstract class Mother {
  public int getAge() { return 45; }
  public abstract class Son {
    public int getAge() { return 38; }
  }
  public static void main(String[] args) {
    Mother m = new Mother() {
      public int getAge() { return 22; }
    };
    Mother.Son s = m.new Son() {
      public int getAge() { return 57; }
    };
    System.out.println(s.getAge() + " " + m.getAge());
  }
}

请问程序的输出结果是什么?
A.

57 22

B.

45 38

C.

45 57

D.

在运行时出现抛出异常

E.

编译失败

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