1 changed files with 29 additions and 0 deletions
@ -0,0 +1,29 @@ |
|||||
|
classDiagram |
||||
|
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 { |
||||
|
+printArea(Shape shape) void |
||||
|
} |
||||
|
Shape <|-- Circle |
||||
|
Shape <|-- Rectangle |
||||
|
Shape <|-- Triangle |
||||
|
ShapeUtil ..> Shape |
||||
Loading…
Reference in new issue