Created
May 24, 2017 05:26
-
-
Save peter279k/d740017b9c7aabe6ecfb793a6ceb3732 to your computer and use it in GitHub Desktop.
TQC+ JAVA
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
import java.util.*; | |
class JPA02 { | |
static Scanner keyboard = new Scanner(System.in); | |
public static void main(String[] args) { | |
test(); | |
test(); | |
test(); | |
test(); | |
test(); | |
} | |
public static void test() { | |
System.out.println("Input a character:"); | |
String ch = keyboard.nextLine(); | |
switch(ch) { | |
case "a": | |
case "b": | |
System.out.println("You entered a or b"); | |
break; | |
case "x": | |
System.out.println("You entered x"); | |
break; | |
case "y": | |
System.out.println("You entered y"); | |
break; | |
default: | |
System.out.println("You entered something else."); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment