How do i show the use of static methods in a UML class diagram?
class A{
public static void test(){
}
}
class B{
public void b(){
A.test();
}
}
How would a class diagram look like, which shows the relationship? UML 2.0 would be prepared, if there is a difference.
To show a static method you underline the name of the static method - have a look here for more detailed info.
As for navigating that relationship; class B
is dependent on the existance of class A
. We can say that class B has a "usage dependency" on class A
class B ----uses----> class A
Hope this helps.