How To Read Data From .txt File Java

In this article you will learn Read Data From .txt File in Java Language Line by Line. This is very easy Step by Step program is written below.


        String str = null;
        try
        {
            BufferedReader in = new BufferedReader(new FileReader(filename));
            while ((str = in.readLine()) != null)
            {
                System.out.println(str+"\n");
            }
            in.close();
        }
            catch (Exception e) {
        }
How To Read Data From .txt File Java How To Read Data From .txt File Java Reviewed by N Jahaan on 04:23 Rating: 5