import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Test {
public static void main (String args[]){
//实例化一个流,用于获取键盘输入
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String theLine = null;
while(true){
try {
theLine = in.readLine();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("theLine is: " + theLine);
}
}
}
Java获取键盘输入[CODE]
最新推荐文章于 2024-02-22 09:51:45 发布