Created
August 11, 2011 10:26
-
-
Save TomTasche/1139335 to your computer and use it in GitHub Desktop.
Use strings in a switch
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
String name = "abc"; | |
switch (name) { | |
case "Anton": | |
System.out.println("a"); | |
break; | |
case "Berta": | |
System.out.println("b"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment