import java.io.*;
public class IoDemo{
public static void main(String[] args)throws Exception{
String str = "";
File file1 = new File("D:\\A.txt");
File file2 = new File("D:\\B.txt");
BufferedReader br = new BufferedReader(new FileReader(file1));
str = br.readLine();
br.close();
str += "\r\n";
br = new BufferedReader(new FileReader(file2));
str += br.readLine();
br.redLine();
//写入
new BufferedWriter(new FileWriter(file2)).writer(str);
}
}
追问写入的内容呢?还是键盘输入啊?你能不能随便加个学号,随便写个姓名,
追答从文件里读的
追问很感谢