package com.cug.datastream;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
public class PrintWriterDemo {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new FileReader("a.txt"));
PrintWriter pw = new PrintWriter(new FileWriter("p.txt"));
String line = null;
while((line = br.readLine())!=null){
pw.println(line);
}
br.close();
pw.close();
}
}
Java基础----PrintWriter
最新推荐文章于 2022-12-06 12:58:53 发布