UML class diagram - represent attribute with initial value

断了今生、忘了曾经 提交于 2021-01-27 05:19:15

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!