String input = "";
InputStreamReader in = new InputStreamReader(System.in);
BufferedReader bufferedReader = new BufferedReader(in);
System.out.print("请输入你的姓名:");
try {
input = bufferedReader.readLine();//获得数据
} catch (IOException e) {
e.printStackTrace();
//System.out.println(e.toString());
}
System.out.println(input);
Java:如何在命令行输入数据
最新推荐文章于 2024-09-11 09:32:05 发布