import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class Exercise2 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new FileReader("day19-笔记.txt"));
List<String> list = new ArrayList<String>();
String line;
while((line=br.readLine()) != null)
list.add(line);
br.close();
BufferedWriter bw = new BufferedWriter(new FileWriter("day19-笔记.txt"));
for(int i = list.size()-1; i<=0; i--){
bw.write(list.get(i));
}
bw.close();
}
}
怎么越界异常了呢? |