- import java.io.*;
- class PrintStreamDemo
- {
- public static void main(String[] args)
- {
- BufferedReader bufr =null;
- PrintWriter pw =null;
- try
- {
- bufr = new BufferedReader(new InputStreamReader(System.in));
- String line=null;
- pw = new PrintWriter(System.out);
- while ((line = bufr.readLine())!=null)
- {
- pw.write(line);
-
- }
- }
- catch (IOException e)
- {
- System.out.println(e.toString());
- }
- finally
- {
- try
- {
- if (bufr!=null)
- {
- bufr.close();
- }
- }
- catch (IOException ex)
- {
- System.out.println(ex.toString());
- }
- try
- {
- if (pw!=null)
- {
- pw.close();
- }
- }
- catch (IOException exc)
- {
- System.out.println(exc.toString());
- }
- }
-
-
- }
- }
复制代码 |
|