[单选择]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() Base.test()
  2. Runtime error. Cannot override a static method by an instance method
  3. Child.test() Child.test()
  4. Compilation error. Cannot override a static method by an instance method
参观人数:824 ,参试人数:13,正确率:38%