Skip to content

Instantly share code, notes, and snippets.

@clarenced
Created August 11, 2011 14:18
Show Gist options
  • Save clarenced/1139758 to your computer and use it in GitHub Desktop.
Save clarenced/1139758 to your computer and use it in GitHub Desktop.
Switch with string in Java7
public static void sayHello(String language){
switch(language) {
case "FR" : System.out.println("Bonjour"); break;
case "EN" : System.out.println("Hello World"); break;
case "JP" : System.out.println("Sayonara"); break;
default: System.out.println(" Hello World");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment