文件名称:RoundArea
- 所属分类:
- JSP源码/Java
- 资源属性:
- [Java] [源码]
- 上传时间:
- 2012-12-23
- 文件大小:
- 4kb
- 下载次数:
- 0次
- 提 供 者:
- 徐*
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
1编写程序,在程序中定义一个抽象类Area、两个Area类的派生子类RectArea类和RoundArea类,以及一个实现类ImpleArea类。程序的实现要求如下。
(1) 抽象类Area类中只包含一个抽象方法:double area()。
(2) 子类RoundArea类通过覆盖父类中的抽象方法area来求圆的面积,另一个子类RectArea类通过覆盖父类中的抽象方法area求长方形的面积。
(3) 圆的半径和长方形的边分别定义为子类RoundArea类和RectArea类的域,都为double类型。
(4) ImpleArea类求出长2.1宽3.0的长方形和半径为4.0的圆的面积,并在屏幕上显示。
2.声明圆类Round,实现Area接口,计算圆面积。
-A program, the program defines an abstract class Area, the two Area class derived the subclass of RectArea Class and RoundArea of class, as well as a the implementation class ImpleArea class. The realization of the program requirements are as follows.
(1) Area class abstract class contains an abstract method: double area ().
(2) sub-class RoundArea of the coverage abstract methods in the parent class area of circular area another subclass RectArea of the abstract methods override the parent class area to find the area of a rectangle.
(3), respectively, the radius of the circle and rectangle edge is defined as the domain the the subclass of RoundArea Class and RectArea of class for type double.
(4) ImpleArea-class determined length 2.1 3.0 wide rectangular and a radius of the area of a circle of 4.0, and is displayed on the screen.
2. Statement circle Round, Area interface, calculate the area of a circle.
(1) 抽象类Area类中只包含一个抽象方法:double area()。
(2) 子类RoundArea类通过覆盖父类中的抽象方法area来求圆的面积,另一个子类RectArea类通过覆盖父类中的抽象方法area求长方形的面积。
(3) 圆的半径和长方形的边分别定义为子类RoundArea类和RectArea类的域,都为double类型。
(4) ImpleArea类求出长2.1宽3.0的长方形和半径为4.0的圆的面积,并在屏幕上显示。
2.声明圆类Round,实现Area接口,计算圆面积。
-A program, the program defines an abstract class Area, the two Area class derived the subclass of RectArea Class and RoundArea of class, as well as a the implementation class ImpleArea class. The realization of the program requirements are as follows.
(1) Area class abstract class contains an abstract method: double area ().
(2) sub-class RoundArea of the coverage abstract methods in the parent class area of circular area another subclass RectArea of the abstract methods override the parent class area to find the area of a rectangle.
(3), respectively, the radius of the circle and rectangle edge is defined as the domain the the subclass of RoundArea Class and RectArea of class for type double.
(4) ImpleArea-class determined length 2.1 3.0 wide rectangular and a radius of the area of a circle of 4.0, and is displayed on the screen.
2. Statement circle Round, Area interface, calculate the area of a circle.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
shiyan6
.......\Area.class
.......\AreaC.class
.......\AreaC.java
.......\ImpleArea.class
.......\ImpleArea.java
.......\RectArea.class
.......\Round.class
.......\Round.java
.......\RoundArea.class