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
答案不对?请尝试站内搜索