package com.rental.shape; public class ShapeTest { public static void drawShape(Shape s) { s.draw(); } public static void main(String[] args) { System.out.println("基础题测试:"); System.out.println("----------------------------"); Shape circle = new Circle(5.0); Shape rectangle = new Rectangle(4.0, 6.0); drawShape(circle); drawShape(rectangle); System.out.println("----------------------------"); } }