java 读取文件


import java.io.*;

public class FileRead {
public static void main(String[] args) {
String read;
FileReader fileread;
BufferedReader bufread;
try {
fileread = new FileReader("c:/sj.txt");
bufread = new BufferedReader(fileread);
try {
while ((read = bufread.readLine()) != null) {
System.out.println(read);
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}
}
阅读更多
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭