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.
29 lines
1.1 KiB
29 lines
1.1 KiB
+---------------------------+
|
|
| <<abstract>> |
|
|
| Shape |
|
|
+---------------------------+
|
|
| |
|
|
+---------------------------+
|
|
| + getArea(): double | <-- 抽象方法
|
|
+---------------------------+
|
|
^
|
|
|
|
|
+----------+----------+----------+
|
|
| | |
|
|
+----------------+ +----------------+ +----------------+
|
|
| Circle | | Rectangle | | Triangle |
|
|
+----------------+ +----------------+ +----------------+
|
|
| - radius: double| | - width: double | | - base: double |
|
|
| | | - height: double| | - height: double|
|
|
+----------------+ +----------------+ +----------------+
|
|
| + getArea(): double| | + getArea(): double| | + getArea(): double|
|
|
+----------------+ +----------------+ +----------------+
|
|
|
|
|
|
+---------------------------+
|
|
| ShapeUtil |
|
|
+---------------------------+
|
|
| |
|
|
+---------------------------+
|
|
| + printArea(Shape): void | <-- 静态方法
|
|
+---------------------------+
|