Posted By:
gaurav_saini
Posted On:
Thursday, April 22, 2004 03:55 AM
Test1.Java
import java.io.*;
class Test1
{
public static void main(String[] args)
{
BufferedReader in=null;
String line=null;
try{
in = new BufferedReader(new InputStreamReader(new FileInputStream("Demo.txt")));
}catch (IOException e) {}
try{
while ((line = in.readLine()) != null)
System.out.println(line);
}catch (IOException e) {}
}
}
Demo.txt
Hello How r u?
I am fine thank u!
Come compile the code
It works!