I want to use a switch-statement where the expression to evaluate against is a String. How can I do that, when the switch-statement only allows Integer or literals as expressions?
I believe in java 5 you would be able to do this using an Enum. I have not tried it myself, but I do seem to remember reading about it in the Features descriptions for Java 5.