black

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){     System.out.println ("Erase "+content);     }     }
执行下列代码的结果是哪项?() 
Pencil pen=new RubberPencil();     
pen.write("Hello");     

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

相关考题

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

单项选择题 使用下列哪些关键字可以判定实参的具体类型?()

多项选择题 涉及类MyClass的方法签名足publicvoidfind(MyClassa),那么该方法可接收的实际参数的类型可以是哪些?()

All Rights Reserved 版权所有©计算机考试题库(jsjtiku.com)

备案号:湘ICP备14005140号-4

经营许可证号:湘B2-20140064