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

class Base

{

void test() {

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

}

}

public class Child extends Base {

void test() {

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

}

static public void main(String[] a) {

Child anObj = new Child();

Base baseObj = (Base)anObj;

baseObj.test();

}

}

Select most appropriate answer.

  1. Child.test()
  2. Base.test() Child.test()
  3. Child.test() Base.test()
  4. Base.test()
参观人数:805 ,参试人数:7,正确率:71%