当前学科:面向对象程序设计
  • 题目: 未知类型

      class A {public int getNumber(int a){return a+1;}} class B extends A {public int getNumber(int a, char c){return a+2;} public static void main(String[] args) {B b=new B(); System.out.println(b.getNumber(0));} } what is the result?

      A.compilation succeeds and 3 is printed

      B.compilation succeeds and 2 is printed

      C.compilation succeeds and 1 is printed

      D.An error at this program cause compilation to fail

    答案: <查看本题扣1积分>

    查看答案

    答案不对?请尝试站内搜索