首页 > 继续教育
题目内容 (请给出正确答案)
[单选题]

publicclassPet{publicvoidspeak(){System.out.print(Pet”);}}publicclassCatextendsPet{publicvoidspeak(){System.out.print(Cat”);}}publicclassDogextendsPet{publicvoidspeak(){System.out.print(Dog”);}}执行代码Pet[]p={newCat(),newDog(),newPet()};for(inti=0;i〈p.length;i++)p[i].speak();后输出的内容是哪项?()

A.PetPetPet

B.CatCatCat

C.CatDogPet

D.CatDogDog

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“publicclassPet{publicvoidspeak…”相关的问题
第1题
Why should the meeting minutes be stored or even archived with other important corpora

A.Because they will be inspected by the government in the futur

B.Because they will be used to protect the organization’s rights and interests.

C.Because they will be evaluated by the management people some day.

D.Because they will be limited to researchers and policy makers, instead of the publi

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改