Skip to content

Instantly share code, notes, and snippets.

@baibinghere
Last active February 13, 2019 14:18
Show Gist options
  • Save baibinghere/fc08184f3c4cdf8bdebfe7d3951076ce to your computer and use it in GitHub Desktop.
Save baibinghere/fc08184f3c4cdf8bdebfe7d3951076ce to your computer and use it in GitHub Desktop.
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