import java.io.*;
class ReaderDemo
{
public static void main(String[] args) throws IOException
{
InputStream in = System.in;
BufferedReader bufr = new BufferedReader(new InputStreamReader(in));
OutputStream out = System.out;
BufferedWriter bufw = new BufferedWriter(new OutputStreamWriter(out));
String line = null;
while((bufr.readLine())!=null)
{
if("over".equals(line))
break;
bufw.write(line.toUpperCase());
bufw.newLine();
bufw.flush();
}
bufr.close();
bufw.close();
}
}
这段代码运行时抛出空指针异常,是说明原因,知道的麻烦帮忙解答一下,多谢了
|
|