Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Use strings in a switch
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