Originally Posted by Fou-Lu
I've never seen an enum actually written out in a uml style before. If I had to guess at it, this is what it represents:
public enum Number
private final int val;
private Number(int val)
this.val = val;
public int getVal()
The val comes to being the actual value associated with the enum number. It could be any datatype you want and can be called just like:
Number one = Number.ONE;
So if getVal() where to return a string, that can be done and replace the "one" value during the "construction" phase of the enum.
Hi thanks for the reply, I appreciate it alot!
I got a question though, in the 2nd example you gave, does that mean that the val of one.getVal would be 1, since it is associated with the enum of ONE?