Skip to content

Instantly share code, notes, and snippets.

@shuu1222
Created May 30, 2019 10:34
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 shuu1222/b506d1d7378cb77cb50cc7122101a986 to your computer and use it in GitHub Desktop.
Save shuu1222/b506d1d7378cb77cb50cc7122101a986 to your computer and use it in GitHub Desktop.
Java Tutorial Switch
String signal = "green";
switch (signal){
case "red":
System.out.println("stop!");
break;
case "blue":
case "green":
System.out.println("Go!");
break;
case "yellow":
System.out.println("Caution!");
break;
default:
System.out.println("WrongSignal");
break;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment