电子科技大学 / JAVA程序设计
正确率:100%
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
参考答案:
佳题速递: