文件名称:RoundArea
-
所属分类:
- 标签属性:
- 上传时间:2013-01-02
-
文件大小:4.37kb
-
已下载: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/
shiyan6/Area.class
shiyan6/AreaC.class
shiyan6/AreaC.java
shiyan6/ImpleArea.class
shiyan6/ImpleArea.java
shiyan6/RectArea.class
shiyan6/Round.class
shiyan6/Round.java
shiyan6/RoundArea.class
shiyan6/Area.class
shiyan6/AreaC.class
shiyan6/AreaC.java
shiyan6/ImpleArea.class
shiyan6/ImpleArea.java
shiyan6/RectArea.class
shiyan6/Round.class
shiyan6/Round.java
shiyan6/RoundArea.class
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.