@startuml ' 形状类图 ' 抽象类 Shape abstract class Shape { + getArea(): double } ' Circle 类 class Circle { - radius: double + Circle(radius: double) + getArea(): double } ' Rectangle 类 class Rectangle { - width: double - height: double + Rectangle(width: double, height: double) + getArea(): double } ' Triangle 类 class Triangle { - base: double - height: double + Triangle(base: double, height: double) + getArea(): double } ' ShapeUtil 工具类 class ShapeUtil { + printArea(shape: Shape): void + main(args: String[]): void } ' 继承关系 Shape <|-- Circle Shape <|-- Rectangle Shape <|-- Triangle ' 使用关系 ShapeUtil --> Shape @enduml