@startumlabstractclassAinterfaceBclassCclassDclassEclassFclassG
'依赖关系:C使用DC..> D
'关联关系:C关联DC--E
'继承关系:F继承DF--|>D
'实现关系:D实现B接口
D..|>B
'聚合关系:G聚合EG--o E
'组合关系:D组合ED--*E@enduml
@startumlclassAnimal{String name
int num
'静态变量
{static}boolean isFly
voidrun()
'抽象方法
{abstract}intgetNUm()@enduml
添加注释
@startumlclassCat{int age
voidrun()voidsetName(String name)}
'注释变量
note left of Cat::age
我今年十八岁
end note
note left of Cat::run()
我会跑步哟
end note
note left of Cat::"setName(String name)"
你可以叫我猫猫哟
end note
classBird{}
'写在哪个元素下方,就是对哪个元素做注释
'选择left/bottom/left/right 分别是在 上下左右 进行备注
note left
这是一个小鸟类
end note
note "我和其他元素没啥关系,是总体的总结" as note1
note "我们都是动物" as note2
Cat.. note2
note2 ..Bird@enduml