本帖最后由 杨胜男 于 2014-6-17 18:33 编辑
import java.io.*;
class TransStreamDemo
{
public static void main(String[] args) throws IOException
{
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.write(line.toUpperCase());//父类Write的write方法?
bufw.newLine();
bufw.flush();
}
bufr.close();
}
}
//bufw.write(line.toUpperCase());//bufw调用的write方法是BufferedWriter类中的方法?还是Writer类中的方法? |
|