Created
August 11, 2011 14:18
-
-
Save clarenced/1139758 to your computer and use it in GitHub Desktop.
Switch with string in Java7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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