文件名称:TestShape
介绍说明--下载内容来自于网络,使用问题请自行百度
写一个父类图形(Shape)(无属性,方法:计算周长,计算面积),
两个子类:矩形(Rect 属性:长,宽;方法:计算周长,计算面积),
圆形(Circle 属性:半径 方法:计算周长,计算面积)
并写一个测试类TestShape,含main方法,创建各个类的对象,用参数化构造方法为属性赋值,输出各个图形的周长和面积。-Write a parent class graphics (Shape) (no properties, methods: calculating perimeter, area calculation), two sub-categories: rectangular (Rect attributes: length, width method: calculation of perimeter, area calculation), round (Circle Properties : radius method: calculation of perimeter, area calculation) and write a test class TestShape, including the main method to create each type of object, parameterized constructor for the attribute assignment, the output of each graphic in the perimeter and area.
两个子类:矩形(Rect 属性:长,宽;方法:计算周长,计算面积),
圆形(Circle 属性:半径 方法:计算周长,计算面积)
并写一个测试类TestShape,含main方法,创建各个类的对象,用参数化构造方法为属性赋值,输出各个图形的周长和面积。-Write a parent class graphics (Shape) (no properties, methods: calculating perimeter, area calculation), two sub-categories: rectangular (Rect attributes: length, width method: calculation of perimeter, area calculation), round (Circle Properties : radius method: calculation of perimeter, area calculation) and write a test class TestShape, including the main method to create each type of object, parameterized constructor for the attribute assignment, the output of each graphic in the perimeter and area.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
TestShape.java
1999-2046 搜珍网 All Rights Reserved.
本站作为网络服务提供者,仅为网络服务对象提供信息存储空间,仅对用户上载内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。
