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.
 
 

22 lines
1.1 KiB

类图说明
plaintext
┌─────────────┐
│ Shape │ (抽象类)
├─────────────┤
│+getArea():double│
└──────┬──────┘
┌─────┴─────┬──────────┐
│ │ │
┌────────┐┌────────────┐┌────────────┐
│ Circle ││ Rectangle ││ Triangle │
├────────┤├────────────┤├────────────┤
│-radius ││-width,-height││-base,-height│
├────────┤├────────────┤├────────────┤
│getArea()││ getArea() ││ getArea() │
└────────┘└────────────┘└────────────┘
 
- 核心关系: Shape  是抽象父类, Circle 、 Rectangle 、 Triangle  继承自  Shape ,实现  getArea()  方法; ShapeUtil  依赖  Shape  类实现统一处理。