Search code examples
javauml

UML diagram - how to show FINAL


How would I display the field

private static final int DAMAGE = 3;

in the UML Diagram?

Should it be shown as: - DAMAGE : 3 : int ?


Solution

  • For an UML representation of a Java project, it should be sufficient to write underlined caps, like…

    A constant in a UML class diagram

    Note that this representation uses a Java convention (constants written in capitals) to highlight it as final instead of a UML annotation, which would be kind of more straight-forward UML, but is too long for my purposes.