package day21lianxi.itcast.cn;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Demo5 {
public static void main(String[] args) throws IOException {
BufferedReader lnr = new BufferedReader(new FileReader("aaa.txt"));
BufferedWriter bfw = new BufferedWriter(new FileWriter("ggg.txt"));
int b;
while((b = lnr.read()) != -1){
bfw.write(b);
}
lnr.close();
bfw.close();
}
}
怎么给ggg文件的每行加上行号啊 |