Test.java
package com.xiami.testServer; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Test { public static void main(String args[]){ InputStreamReader inputstremreader = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(inputstremreader); try { while(true){ String temp = br.readLine(); System.out.println(temp); } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
注:
运行后,在Console视图中输入一行文字,按回车可以得到输入的文字或者字符。