public class ShapeUtil { // 统一打印任意图形的面积 public static void printArea(Shape shape) { System.out.println("图形面积 = " + shape.getArea()); } }