Last active
February 13, 2019 14:18
-
-
Save baibinghere/fc08184f3c4cdf8bdebfe7d3951076ce to your computer and use it in GitHub Desktop.
This file contains hidden or 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
package com.test; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
public class Main { | |
public static void main(String[] args) throws IOException { | |
System.out.print("Enter you choices: "); | |
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); | |
String result = reader.readLine(); | |
// Assume I input 1,2,3 | |
String[] choices = result.split(","); | |
for (String choice : choices) { | |
System.out.println(choice); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment