试题详情
- 单项选择题 现有: 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、运行时抛出异常
- D
关注下方微信公众号,在线模考后查看
热门试题