欢迎来到易学考试网 易学考试官网
全部科目 > Java认证考试 > 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();

    点击查看答案

    相关考题

    微信小程序免费搜题
    微信扫一扫,加关注免费搜题

    微信扫一扫,加关注免费搜题