摘录自:http://www.cnblogs.com/springcsc/archive/2009/12/03/1616372.html
================================
类System的应用
================================
/**
* 读取控制台输入,并将输入的内容显示到控制台
*/
public class ReadConsole1 {
public static void main(String[] args) {
try{
//提示信息
System.out.println("请输入:");
//数组缓冲
byte[] b = new byte[1024];
//读取数据
int n = System.in.read(b);
//转换为字符串
String s = new String(b,0,n);
//回显内容
System.out.println("输入内容为:" + s);
}catch(Exception e){}
}
}