public static void main(String[] args) {
InputStreamReader ipsReader = new InputStreamReader(System.in);
BufferedReader bufReader = new BufferedReader(ipsReader);
String string = null;
try {
string = bufReader.readLine();
while (!string.equalsIgnoreCase("exit")) {
System.out.println(string);
string = bufReader.readLine();
}
} catch (IOException e) {
e.printStackTrace();
}
}
转载于:https://www.cnblogs.com/oversea201405/p/3749578.html