Skip to main content

Posts

Showing posts with the label java file handling read file line by line

java program to read file line by line

lets learn how to write java  program to read file line by line code is given below follow the steps from video import java.io.*; // program by Prakash Sonar class JfReadLine {   public static void main(String s[])   {     try {  FileReader r=new FileReader("t2.txt");  BufferedReader br=new BufferedReader(r);  String line;  while((line=br.readLine())!=null)  {  System.out.println(line);  } r.close(); } catch( Exception e) { }   } }

Labels

Show more