> 其他 >
1. 定义一个接口Area,其中包含一个计算面积的抽象方法calculateArea.
1.\x09定义一个接口Area,其中包含一个计算面积的抽象方法calculateArea(),然后设计MyCircle和MyRectangle两个类都实现这个接口中的方法calculateArea(),分别计算圆和矩形的面积.
是JAVA程序!
人气:274 ℃ 时间:2020-07-17 08:26:51
解答
public interface Area {\x05public double calculateArea();}public class MyRectangle {double length;double width; public MyRectangle(double length,double width){\x05 this.length = length;\x05 this.width...
推荐
猜你喜欢
© 2025 79432.Com All Rights Reserved.
电脑版|手机版