Created
May 30, 2019 10:34
-
-
Save shuu1222/b506d1d7378cb77cb50cc7122101a986 to your computer and use it in GitHub Desktop.
Java Tutorial 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 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