1、按以下要求编写程序 (1) 创建抽象类Shape,添加width和height两个成员变量,抽象方法计算周长和面积

日期:2015-07-16 14:29:41 人气:1

1、按以下要求编写程序 (1) 创建抽象类Shape,添加width和height两个成员变量,抽象方法计算周长和面积

public class Main { public static void main(String[] args) { Rectangle rect = new Rectangle(4, 5); System.out.println("Perimeter is: " + rect.getPerimeter()); System.out.println("Area is: " + rect.getArea()); }}abstract class Shape
    A+
热门评论