79 Java BufferedReader 获取键盘输入

package new20140519;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * BufferedReader 获取键盘输入
 * @author x
 *
 */
public class KeyBoardIn {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub

		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String line=null;
		//读取键盘输入
		while((line=br.readLine()) != null)
		{
			System.out.println("当前用户输入:"+line);
		}
	}

}

你可能感兴趣的:(Java)