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.

27 lines
780 B

+----------------+
| Shape |
+----------------+
| + getArea(): double |
+----------------+
^
|
+------+------+------+
| | |
+--------+ +----------+ +----------+
| Circle | | Rectangle| | Triangle |
+--------+ +----------+ +----------+
| - radius: double | | - length: double | | - base: double |
| + Circle(radius: double) | | + Rectangle(length: double, width: double) | | + Triangle(base: double, height: double) |
| + getArea(): double | | + getArea(): double | | + getArea(): double |
+--------+ +----------+ +----------+
+----------------+
| ShapeUtil |
+----------------+
| + printArea(shape: Shape): void |
+----------------+
|
v
+----------------+
| Shape |
+----------------+