package step3;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Task {
public void task() throws IOException{
/********* Begin *********/
String file1 = "src/step3/input/input.txt";
FileReader fr = new FileReader(file1);
char[] ch = new char[8];
fr.read(ch);
String file2 = "src/step3/output/output.txt";
FileWriter fw = new FileWriter(file2);
fw.write(ch);
fr.close();
fw.flush();
fw.close();
/********* End *********/
}
}
Educoder -Java高级特性 - IO流( 第3关:字符流 - 输入输出)
最新推荐文章于 2024-05-21 23:50:10 发布