Skip to content

Instantly share code, notes, and snippets.

@philihp
Created January 23, 2012 04:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philihp/1660537 to your computer and use it in GitHub Desktop.
Save philihp/1660537 to your computer and use it in GitHub Desktop.
Java 7 switching on a String
switch(suit) {
case "club":
case "diamond":
trickValue = 20;
break;
case "heart":
case "spade":
trickValue = 30;
break;
case "no-trump":
trickValue = 40;
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment