Reputation: 11
I am trying to create a UML class diagram for one of my classes and am unsure how to represent a certain element of the class. One of the methods within my class has a method within it. How would I represent this in the diagram?
public void start(){
...
@Override
public void run(){
...
}
}
Upvotes: 1
Views: 1026
Reputation: 20446
In java
you can't have method inside method.
What you have is method inside anonymous class inside method.
So you have to put that anonymous class in your diagram and add method to it.
PS: Some languages allow method inside methods. In that case you do not add them to class diagram because those inner method is implementation details.
Upvotes: 6