aspose file tools*
The moose likes Beginning Java and the fly likes Ugly Enum Code. Please help make it more proper Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Ugly Enum Code. Please help make it more proper" Watch "Ugly Enum Code. Please help make it more proper" New topic
Author

Ugly Enum Code. Please help make it more proper

Francis Zabala
Ranch Hand

Joined: Aug 11, 2010
Posts: 30
Hello again guys!

I have a question on enums. First, the code:



I was trying to add "What the? " and "Mom" when GIZPACHIO is used so that the output of



would be "Mom! What the?"

I thought that line 7 to line 9 would work but well..



Is there a way to achieve this without doing the code /*System.out.println(cs.star.SayIt(cs.star.SayIt()));*/ ?
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

I'm not really sure why it isn't allowed but it can be fixed by using:


and instead of
You can useAnd finally methods should start with a lowercase letter.


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Francis Zabala
Ranch Hand

Joined: Aug 11, 2010
Posts: 30
Sorry for the late response and thanks Wouter Oet! Hahaha! Man, that was so simple!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ugly Enum Code. Please help make it more proper