black

SCJP程序员认证考试

登录

填空题

Given the following code, write a line of code that, when inserted at the indicated location, will make the overriding method in Extension invoke the overridden method in class Base on the current object.  
class Base {  
public void print() {  
System.out.println("base");  
}  
}  
class Extention extends Base {  
public void print() {  
System.out.println("extension");  
// insert line of implementation here  
}  
} 
 public class Q294d {  
public static void main(String args[]) {  
Extention ext = new Extention();  
ext.print();  
}  
}  
Fill in a single line of implementation.()

【参考答案】

super.print();

相关考题

单项选择题 Whichstatementsaretrue,giventhecodenewFileOutputStream("data",true)forcreatinganobjectofclassFileOutputStream?()

多项选择题 WhichstatementsconcerningtheeventmodeloftheAWTaretrue?()

单项选择题 What will be the appearance of an applet with the following init() method?   public void init() {   add(new Button("hello"));  }

All Rights Reserved 版权所有©易学考试网(yxkao.com)

备案号:湘ICP备2022003000号-3