欢迎来到易学考试网 易学考试官网
全部科目 > Java认证考试 > Java认证考试综合练习

单项选择题

现有:     
class Pencil  { 
public void write (String content){     System.out.println( "Write",+content){     }     }class RubberPencil extends Pencil{     public void write (String content){ 
System.out.println("Rubber Write"+content);     } 
public void erase (String content)}} 
执行下列代码的结果是哪项?()     
Pencil  pen=new  Pencil(); 
(( RubberPencil) pen).write( "Hello");    

    A.Write Hello
    B.Rubber Write Hello
    C.编译失败
    D.运行时抛出异常

点击查看答案&解析

相关考题

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

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