问题
How is an attribute with initial value (such as a static constant) represented in UML?
public class Foo {
public static final int BAR = 17;
}
回答1:
The initial value of an attribute in a UML class diagram is represented just like variable assignment in a language like Java.
Moreover, since the example attribute is static, it should be underlined. Capitalization is by language or other convention and is not a UML specification.
来源:https://stackoverflow.com/questions/36323833/uml-class-diagram-represent-attribute-with-initial-value