S
Subhabrata
Dear Group,
I am a new learner in Java. And I wanted to open a file and read its
content.
The standard tutorials give long code. They use try,catch etc. I
wanted something simple and started to experiment something as
follows. But it was giving some error.
import java.io.*;
public class FileOutput {
/**
* @param args
*/
public static void main(String[] args) {
FileInputStream fstream = new FileInputStream("C:\\FileIO\
\javadict.txt");
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine;
System.out.println(br.strLine);
}
// TODO Auto-generated method stub
}
If any one in the room can kindly suggest.
Regards,
Subhabrata.
NB: Thank you all for your earlier solution though I worked my own
with .equals only.
I am a new learner in Java. And I wanted to open a file and read its
content.
The standard tutorials give long code. They use try,catch etc. I
wanted something simple and started to experiment something as
follows. But it was giving some error.
import java.io.*;
public class FileOutput {
/**
* @param args
*/
public static void main(String[] args) {
FileInputStream fstream = new FileInputStream("C:\\FileIO\
\javadict.txt");
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine;
System.out.println(br.strLine);
}
// TODO Auto-generated method stub
}
If any one in the room can kindly suggest.
Regards,
Subhabrata.
NB: Thank you all for your earlier solution though I worked my own
with .equals only.