文件名称:InterfaceTest
- 所属分类:
- JSP源码/Java
- 资源属性:
- [Java] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 4kb
- 下载次数:
- 0次
- 提 供 者:
- 胡*
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
在第 (3) 小题中由于新加入的 Clock 类仅仅实现了 Soundable 接口的stopsound() 和playsound() 方法 , 而 increaseVolume() 和 decreaseVolume() 方法没有实现 , 因此它实质上是一个抽象类 , 而抽象类是不能实例化的 , 所以导致编译错误。但是按照常理 , 闹钟的滴答声确实是不可以增大或减小的 , 那么如何解决这个问题呢 ? 现在请在 Clock 类中加入下面两个含 {}空方法体的方法实现 , 再编译运行程序 , 看看会有什么变化。-In paragraph (3) small problems in the Clock class because only new entrants to achieve a Soundable interface stopsound () and playsound () method, and increaseVolume () and decreaseVolume () method not implemented, so it is essentially an abstract class The abstract class can not be instantiated, thus resulting in a compile error. But according to common sense, is indeed a ticking alarm clock can not increase or decrease, then how to solve this problem? Now add in the Clock class {} with the following two methods to achieve an empty method body, and then compile and run the program to see what changes.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
InterfaceTest\Clock.class
.............\InterfaceTest.class
.............\InterfaceTest.java
.............\Mobilephone.class
.............\People.class
.............\Radio.class
.............\Soundable.class
.............\Walkman.class
InterfaceTest
.............\InterfaceTest.class
.............\InterfaceTest.java
.............\Mobilephone.class
.............\People.class
.............\Radio.class
.............\Soundable.class
.............\Walkman.class
InterfaceTest