0

How do I represent this in a UML class diagram?

public class MyClass {
    public enum MyEnum {
        SOMETHING
    }
}

How do I show the relationship between the class and the enum?

cervonwong
  • 388
  • 3
  • 12
  • you represent the class as [class](https://www.ibm.com/support/knowledgecenter/SS8PJ7_9.7.0/com.ibm.xtools.modeler.doc/topics/cclss.html) and the enum as [enum](https://www.ibm.com/support/knowledgecenter/SS8PJ7_9.7.0/com.ibm.xtools.modeler.doc/topics/cenum.html). – Turing85 Aug 01 '20 at 12:35
  • @Turing85 how do I show the relationship between them? (Updated question) – cervonwong Aug 01 '20 at 12:39
  • 1
    You mean the implicit relationship due to inner classing? I am not sure that there is a symbol for this in UML. Do you use this feature? If not, I would recommend making `MyEnum` a `static` inner class or a separate class. EDIT: Turns out, there is [a specification for nesting classes](https://www.uml-diagrams.org/nested-classifier.html). – Turing85 Aug 01 '20 at 12:41

0 Answers0