Read From File In Java

To read a text file, we use FileReader and wrap it in a BufferedReader.

In the below example, we read a file named “FileToRead.txt” which is located in my local system and output the file line by line in my eclipse console.

Sample Program:

Read More: Java Tutorial

Get our latest blog posts delivered to your inbox

Subscribe and get popular blog posts about software testing industry.

Rajkumar

Leave a Comment

Share via
Copy link
Powered by Social Snap