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

switch statement

 
Frank Hale
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Every switch statement I've seen looks similar to

But I would like to replace the 1,2,3 with identifiers like
public static final Something = 1;
public static final SomethingElse = 2;
So that the case statements look like:
case Something: break;
case SomethingElse: break;
Can I do this? How? I can't get it to compile.
Thanks,
Frank
 
Frank Hale
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops I had a bug in my code, I've got it working now!
Frank
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic