Now I am going to show you a example on class diagram
see the following java code
see the following java code
public class CrazyCoder {
public int num1;
public int num2;
public int add(){
return num1+num2;
}
public int sub(){
return num1-num2;
}
public int mul(){
return num1*num2;
}
public int div(){
return num1/num2;
}
}
What will be the class diagram of this code???
Let's solve it
At first you have to follow the Rules
in the diagram the 1st part will contain class name
2nd part will contain it's properties/variables
and 3rd part will contain the methods
See also UML in java
Happy coding :)
0 comments:
Post a Comment