@startuml ' 设置样式 skinparam classAttributeIconSize 0 skinparam backgroundColor #FEFEFE skinparam class { BackgroundColor #E1F5FE BorderColor #0288D1 ArrowColor #0288D1 } abstract class Shape { {abstract} + getArea(): double } class Circle { - radius: double + Circle(radius: double) + getArea(): double } class Rectangle { - width: double - height: double + Rectangle(width: double, height: double) + getArea(): double } class Triangle { - base: double - height: double + Triangle(base: double, height: double) + getArea(): double } class ShapeUtil { + {static} printArea(shape: Shape): void } ' 继承关系 Shape <|-- Circle Shape <|-- Rectangle Shape <|-- Triangle ' 依赖关系 ShapeUtil ..> Shape : uses @enduml