circle

所属分类:其他
开发工具:Java
文件大小:1KB
下载次数:0
上传日期:2018-06-30 16:13:28
上 传 者渣渣一
说明:  (1)设计一个表示圆的类Circle,其中有半径属性、构造方法和计算圆面积的方法; (2)设计一个表示圆柱体的类Cylinder,它继承自圆类Circle,它包含有表示圆柱体高的protected类型的成员变量h,获取和设置h值的public方法、计算圆柱体体积的public方法; (3)要求父类和子类位于不同的包中; (4)编写一个用于测试的主类,对Cylinder类进行测试。
((1) design a class Circle that represents circles, including radius attribute, construction method and circle area calculation method. (2) design a class Cylinder that represents a cylinder, which inherits from the circle Circle, which contains a member variable H that represents the high protected type of the cylinder, the public method for obtaining and setting the H value, and the public method for calculating the volume of the cylinder; (3) requiring the parent and subclasses to be located in different packages; (4) write a main class for testing and test the Cylinder class.)

文件列表:
Circle.java (480, 2016-05-19)
Circle.class (846, 2018-06-21)

近期下载者

相关文件


收藏者