文件名称: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.
(系统自动生成,下载前可以参看下载内容)

下载文件列表

ShapeExp1.java

本Java程序设计详细要求.txt

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度更多...
  • 请直接用浏览器下载本站内容,不要使用迅雷之类的下载软件,用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*主  题:
*内  容:
*验 证 码:

源码中国 www.ymcn.org