皮皮学,免费搜题
登录
logo - 刷刷题
搜题
【简答题】
自定义一个异常类NoThisSongException和Player类,在Player的play()方法中使用自定义异常,要求如下: 1) NoThisSongException继承Exception类,类中有一个无参和一个接收一个String类型参数的构造方法,构造方法中都使用super关键字调用父类的构造方法。 2) Player类中定义一个play(int index)方法,方法接收一个int类型的参数,表示播放歌曲的索引,当index>10时,paly()方法用throw关键字抛出NoThisSongException异常,创建异常对象时,调用有参的构造方法,传入“您播放的歌曲不存在”。 3) 在测试类中创建Player对象,并调用play()方法测试自定义的NoThisSongException异常,使用try...catch语句捕获异常,调用NoThisSongException的getMessage()方法打印出异常信息。 评价指标: 1、代码编写规范,60 2、有注释,+10 3、命名规范,+10 4、有运行结果截图,+10 5、代码独特,+10
手机使用
分享
复制链接
新浪微博
分享QQ
微信扫一扫
微信内点击右上角“…”即可分享
反馈
参考答案:
举一反三
【单选题】听力原文:M: Couldn't you have at least tried to argue with the professor about our project? W: I'm not sure what else I could say. Besides, he did see things our way in the end so let's keep our fingers c...
A.
The professor will change his mind.
B.
The professor may change his mind.
C.
Its best not to make the professor angry.
D.
The professor wouldn't change his mind.
【单选题】Whenever you see an old film, even one made as little as ten years ago, you cannot help being struck by the appearance of the women taking part. Their hairstyles and make-up look dated their skirts lo...
A.
introducing an illusion.
B.
making a comparison.
C.
depicting a vivid scene.
D.
posing a sharp contrast.
【单选题】You cannot see_________ on one trip.
A.
nothing
B.
everything
C.
something
D.
anything
【单选题】How can you argue for restricting the purchase of private cars when you own one and constantly use it ?
A.
ad hominem (abusive)
B.
ad hominem ( you too)
C.
appeal to the people (bandwagon approach)
D.
appeal to the people (snob approach)
【简答题】根据规定,详图符号的圆应以直径为 mm粗实线绘制。
【多选题】水路运输的特点有( )
A.
运输量大,运价较低
B.
能源、资源消耗少
C.
受外界条件影响较大
D.
运输环节多
【判断题】昆曲被称为“中国百戏之祖”。
A.
正确
B.
错误
【单选题】Whenever you see an old film, even one made as little as ten years ago, you cannot help being struck by the appearance of the women taking part. Their hair-styles and make-up look dated their skirts l...
A.
new fashions in clothes reflect the qualities of women
B.
new fashions in clothing are created solely for commercial exploitation of women
C.
the top designers seem to have the right to creating new fashion
D.
men have the basic quality of reliability
【单选题】According to the article, you think the bees ______.
A.
cannot see colors
B.
sometimes can see colors
C.
seeing colors or not it was not understood by people
D.
can see colors
【单选题】患者女,50岁。3个月来多饮、多尿、多食、体重减轻,2天前出现高热、咳嗽、咳黄色脓痰,今晨患者感到极度口渴、恶心、呕吐、呼气呈烂苹果味,随即昏迷人院。首先应给予的处理措施为
A.
静脉注射10%葡萄糖溶液
B.
应用洋地黄类药物
C.
迅速输液,静脉滴注胰岛素
D.
应用呼吸兴奋剂
E.
应用大剂量抗生素
相关题目:
参考解析:
知识点:
题目纠错 0
发布
创建自己的小题库 - 刷刷题