可以用BufferedRead来接受输入字符
import java.io.*;
public class ShowArray {
public static void main(String[] args) {
String s = " ";
try {
BufferedReader in =
new BufferedReader(new InputStreamReader(System.in));
s = in.readLine();
in.close;
System.out.println(s);
} catch (Exception e) {
System.out.println(e);
}
}
}
转载于:https://www.cnblogs.com/tianguook/archive/2012/07/31/2616534.html