如何能使程序调用Base类的构造方法输出"baseconstructor";

如何能使程序调用Base类的构造方法输出"baseconstructor";

classBase{

Base(inti){

System.out.println("baseconstructor");

}

Base(){}

}

publicclassSupextendsBase{

publicstaticvoidmain(Stringargv[]){

Sups=newSup();

//One

}

Sup(){

//Two

}

publicvoidderived(){

//Three

}

}

A.在//One行之后放置Base(10);

B.在//One行之后放置super(10);

C.在//Two行之后放置super(10);

D.在//Three行之后放置super(10);

正确答案:C

猜你喜欢