nus-cs2113-AY2021S2 / forum

5 stars 0 forks source link

UML notation for overloaded methods #51

Closed kwokyto closed 3 years ago

kwokyto commented 3 years ago

Is there any specific UML notation for methods with the same name that are overloaded?

e.g. public void printThing(String message) { print(message); }

public void printThing(String message, int x) { while (x--) { print(message); } }

okkhoy commented 3 years ago

There is no specific notation. You need to specify both/all overloaded methods with full signature in the diagram. So your class diagram will have a printThing(:String) and a printThing(:String, :int) in the methods field.

kwokyto commented 3 years ago

okay thanks prof!