BufferedReader in = new BufferedReader(new FileReader("D://bug.txt"));
String line = null;
List<String> list = new ArrayList<String>();
while((line = in.readLine())!=null)
{
//System.out.println(line);
list.add(line);
}
for(String temp: list){
System.out.println(temp);
}
Java 按行读取文本文件内容
最新推荐文章于 2022-11-25 21:41:23 发布