返回
软件
分类

必赢备用网址BufferedReader和BufferedWriter实例

日期: 2020-03-23 13:45 浏览次数 : 151

import java.io.*;
public class Test {
    public static void main(String[] args) {
        try {
必赢备用网址 ,            FileReader input = new FileReader("Test.java");
            BufferedReader br = new BufferedReader(input);
            FileWriter output = new FileWriter("temp.txt");
            BufferedWriter bw = new BufferedWriter(output);
            String s = br.readLine();            
            while ( s!=null ) {
                bw.write(s);
                bw.newLine();        
                s = br.readLine();
            }            
            br.close();
            bw.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}