使用控制台输入
InputStreamReader is=new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(is);
try {
       String input=br.readLine();
       System.out.println("input is:"+input);
} catch (IOException e) {
       e.printStackTrace();
}