File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes switch statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "switch statement" Watch "switch statement" New topic
Author

switch statement

Frank Hale
Ranch Hand

Joined: Mar 25, 2000
Posts: 230
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

Joined: Mar 25, 2000
Posts: 230
Oops I had a bug in my code, I've got it working now!
Frank
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: switch statement
 
Similar Threads
final variable in switch
:( one more stupid misstake, pls help me !
Box or Unbox
Problems understanding the "default case" in a switch statement
Accessor methods on enum