9

How is an attribute with initial value (such as a static constant) represented in UML?

public class Foo {
    public static final int BAR = 17;
}
ThisClark
  • 14,352
  • 10
  • 69
  • 100

1 Answers1

22

The initial value of an attribute in a UML class diagram is represented just like variable assignment in a language like Java.

enter image description here

Moreover, since the example attribute is static, it should be underlined. Capitalization is by language or other convention and is not a UML specification.

ThisClark
  • 14,352
  • 10
  • 69
  • 100