Sunday, 2 July 2023

PlantUML: Add note on overloaded methods or methods with same name

Example

note right of ArithmeticUtil::"sum(int a, int b)"
	Return sum of a and b
end note

note left of ArithmeticUtil::"sum(int a, int b, int x)"
	Return sum of a, b and c
end note

noteOnOverloadedMethods.txt

@startuml

class ArithmeticUtil{

	' public static fields
	+{static} int sum(int a, int b)
	+{static} int sum(int a, int b, int c)
}

note right of ArithmeticUtil::"sum(int a, int b)"
	Return sum of a and b
end note

note left of ArithmeticUtil::"sum(int a, int b, int c)"
	Return sum of a, b and c
end note

@enduml

Above snippet generate below diagram.





Previous                                                    Next                                                    Home

No comments:

Post a Comment