[单选择]What will be the output when you compile and execute the following program.

class Base

{

static void test() {

System.out.println(“Base.test()”);

}

}

public class Child extends Base {

void test() {

System.out.println(“Child.test()”);

Base.test(); //Call the parent method

}

static public void main(String[] a) {

new Child().test();

}

}

Select most appropriate answer.

  1. Child.test() Child.test()
  2. Child.test() Base.test()
  3. Compilation error. Cannot override a static method by an instance method
  4. Runtime error. Cannot override a static method by an instance method
参观人数:753 ,参试人数:3,正确率:100%