文件名称:ShapeExp1
- 所属分类:
- JSP源码/Java
- 资源属性:
- [Java] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 1kb
- 下载次数:
- 0次
- 提 供 者:
- 李*
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
个人原创代码:矩形、圆形、正方形等形状的操作。编写Java Application程序,定义抽象类Shape,抽象方法为showArea(),求出面积并显示,定义矩形类Rectangle,正方形类Square,圆类 Circle,根据各自的属性,用showArea方法求出各自的面积,在main方法中构造3个对象,调用showArea方法。
定义接口DiagArea,其中包含方法double getDiagonal()求对角线长, double getArea()求面积,定义一个矩形类,实现此接口,并自行扩充成员变量和方法,定义一个正方形类继承矩形类(如矩形有长w和宽h,正方形有边x,并有相应的构造函数,有一个方法中一次直接显示边长、面积和对角线长),在另一类中的主方法里使用测试该类。-Personal original code: the operation of the rectangles, circles, squares and other shapes.Write java application procedures, the definition of abstract class Shape, abstract methods showArea (), calculate the area and define the rectangle class Rectangle, Square class Square, round class of the Circle, according to their respective properties, find the respective area showArea method,in the main method to construct three objects, to call showArea method.
Defined interface DiagArea, which contains the method of a double getDiagonal () Find the diagonal, double the getArea () find the area to define a rectangle class implements this interface, and to expand their own member variables and methods, define the class inheritance of a square rectangle (such as length w and width h, rectangle, square edge of the x, and corresponding constructor, a method is a direct display side length, area and diagonal length), the other in the main method to test the classes.
定义接口DiagArea,其中包含方法double getDiagonal()求对角线长, double getArea()求面积,定义一个矩形类,实现此接口,并自行扩充成员变量和方法,定义一个正方形类继承矩形类(如矩形有长w和宽h,正方形有边x,并有相应的构造函数,有一个方法中一次直接显示边长、面积和对角线长),在另一类中的主方法里使用测试该类。-Personal original code: the operation of the rectangles, circles, squares and other shapes.Write java application procedures, the definition of abstract class Shape, abstract methods showArea (), calculate the area and define the rectangle class Rectangle, Square class Square, round class of the Circle, according to their respective properties, find the respective area showArea method,in the main method to construct three objects, to call showArea method.
Defined interface DiagArea, which contains the method of a double getDiagonal () Find the diagonal, double the getArea () find the area to define a rectangle class implements this interface, and to expand their own member variables and methods, define the class inheritance of a square rectangle (such as length w and width h, rectangle, square edge of the x, and corresponding constructor, a method is a direct display side length, area and diagonal length), the other in the main method to test the classes.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
ShapeExp1.java
本Java程序设计详细要求.txt
本Java程序设计详细要求.txt