Java 读文件

public static void read_file() {
        try {
            BufferedReader in = new BufferedReader(new FileReader("D:/idle/IdeaProject/test/src/resume/test.txt"));
            String str;
            while ((str = in.readLine()) != null) {
                System.out.println(str);
            }
            //System.out.println(str);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

猜你喜欢

转载自blog.csdn.net/qq_40771567/article/details/114375702