Files
Java/Experiment/graph/Exp4/Graphic.mermaid
2025-11-06 10:29:13 +08:00

33 lines
715 B
Plaintext

classDiagram
class Graphic {
<<interface>>
+ double area()
+ double perimeter()
}
class Circle {
- double radius
+ Circle(double radius)
+ double area()
+ double perimeter()
+ double getRadius()
}
class Rectangle {
- double width
- double height
+ Rectangle(double width, double height)
+ double area()
+ double perimeter()
+ double getWidth()
+ double getHeight()
}
class Test {
+ main(String[] args)
}
Graphic <|.. Circle : 实现
Graphic <|.. Rectangle : 实现
Test --> Circle : 创建与使用
Test --> Rectangle : 创建与使用