package fileInOut;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
public class FileReaderBufferReader {
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
FileReader f;
try {
f = new FileReader("D://a.txt");
BufferedReader b = new BufferedReader(f);
String line=b.readLine();
while (line!=null) {
System.out.println(line);
line=b.readLine();
}
b.close();
f.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
System.out.println("文件不存在!");
}
}
}
123456实力创业