UML help

This question is about making sure proper UML notations are used to accomplish the followings. Coding questions, if any, will be asked in a new post.

Class name: MyInteger to have...

- An int data field named value that stores the int value represented by this object

- A constructor that creates a MyInteger object for the specified int value.

- A get method that returns the int value.

- Methods isEven(), isOdd(), and isPrime() that returns true or false

- Static methods isEven(), isOdd(), and isPrime() that returns true or false

- Static methods isEven(MyInteger), isOdd(MyInteger), and isPrime(MyInteger) that returns true or false.

- Methods equals(int) and equals(MyInteger) that returns true or false.

- A static method parseInt(char[]) that converts an array of numeric characters to an int value.

- Methods equals(int) and equals(MyInteger) that returns true or false.

- A static method parseInt(char[]) that converts an array of numeric characters to an int value.

- A static method parseInt(char[]) that converts an array of numeric characters to an int value.

This is from an old text book but it is not classwork. I am stuiying it to make sure all of the points are understood. With focus on UML at this point.

Below, I have done as much as I knew how. There are areas that need to be modified. Could you please review and let me know how I can corrects the errors in it?


Thank you.
UML-1.png
LVL 34
Mike EghtebasDatabase and Application DeveloperAsked:
Who is Participating?
 
Mike EghtebasConnect With a Mentor Database and Application DeveloperAuthor Commented:
gregg_s,

Thank you for the response.

re:> just curious, why do you want to use static for your methods?

This is the statement of the problem. I am not choosing to use static.

See:

http://www.experts-exchange.com/Programming/Languages/Java/Q_27415318.html

Mike
0
 
GreggConnect With a Mentor Commented:
on thing i see so far is missing the setter. In the event the default constructor is used, setter is needed.

+ setValue(int: value) : void
0
 
GreggCommented:
just curious, why do you want to use static for your methods?
0
 
Mike EghtebasDatabase and Application DeveloperAuthor Commented:
I was able to complete the UML portion.
0
 
GreggCommented:
Thanks eghtebas, You really did an excellent job on UML diagram.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.