Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ugly Enum Code. Please help make it more proper

 
Francis Zabala
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Francis Zabala
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for the late response and thanks Wouter Oet! Hahaha! Man, that was so simple!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic