You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
522 B
20 lines
522 B
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("----------------------------");
|
|
}
|
|
}
|