public class ReadInDome {
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
//读取键盘输入对象
InputStream is=System.in;
//字节流转换成字符流
InputStreamReader isr=new InputStreamReader(is);
//用缓冲区来修饰字符流,提高效率
BufferedReader br=new BufferedReader(isr);
String len="sdf";
while((len=br.readLine())!=null)
{
if("over".equals(len))
break;
System.out.println(" "+len);
}
br.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
|
|