(每日一练java)按行读取文件

FileRead

以下 FileRead 程序中,是按行读取文件的是:

import java.io.*;

public class FileRead {
    public static void main(String[] args) throws IOException {
        String filePath = "test.txt";
        File file = new File(filePath);
        BufferedReader reader = new BufferedReader(new FileReader(file));
        String lineString = null;
        while ((lineString = reader.readLine()) != null) {
            System.out.println(lineString);
        }
        reader.close();
    }
}

上一篇:I.MX6 Android USB Touch eGTouchA.ini文件存放


下一篇:P5709 【深基2.习6】Apples Prologue / 苹果和虫子