试题详情
单项选择题 class A {  public byte getNumber() {  return 1;  }  }  class B extends A {  public short getNumber() {  return 2;  }  public static void main(String args[]) {  B b = new B();  System.out.println(b.getNumber()); }  }   What is the result?()

A、 1

B、 2

C、 An exception is thrown at runtime.

D、 Compilation fails because of an error in line 8.

E、 Compilation fails because of an error in line 14.

  • D
  • 关注下方微信公众号,在线模考后查看

热门试题