java键盘输入字符串数组

 1 import java.io.*;
2
3 public class InputStrings {
4 public static void main(String[] args) {
5 // TODO Auto-generated method stub
6 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
7 String[] str = null;
8 try {
9 str = br.readLine().split(",");
10 } catch (Exception e) {
11 // TODO Auto-generated catch block
12 e.printStackTrace();
13 }
14 for(int i=0;i<str.length;i++){
15 System.out.print(str[i] + " ");
16 }
17 }
18
19 }
原文地址:https://www.cnblogs.com/winkey4986/p/2290245.html