@startuml
' Define interfaces
interface ITriangle {
+DisplayArea()
}
interface IRectangle {
+DisplayArea()
}
' Define class
class TestShape {
-triangleBase : double
-triangleHeight : double
-rectangleLength : double
-rectangleWidth : double
+TestShape(tBase: double, tHeight: double, rLength: double, rWidth: double)
+DisplayAllAreas()
{abstract} +ITriangle.DisplayArea()
{abstract} +IRectangle.DisplayArea()
}
' Define class Program with Main method
class Program {
+Main(args: string\[\]) : void
}
' Relationships
TestShape ..|> ITriangle
TestShape ..|> IRectangle
@enduml