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

Rajkumar SM is a founder of SoftwareTestingMaterial. He is a certified Software Test Engineer by profession and blogger & youtuber by choice. He has an extensive experience in the field of Software Testing. He writes here about Software Testing which includes both Manual and Automation Testing. He loves to be with his wife and cute little kid 'Freedom'.

Leave a Comment

Share via
Copy link
Powered by Social Snap