在学到IO流的时候,讲到键盘录入,为什么 writer也能直接打印数据,他不是写入数据到文件中吗?
BufferedReader bufr= new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bufw =new BufferedWriter(new OutputStreamWriter(System.out));
String line = null;
while((line=bufr.readLine())!=null)
{
if("over".equals(line)
break;
bufw.writer(line.toUpperCase());
bufw.newLine();
bufw.flush();
} |