English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

is there any class to read file? i want to create a mini dictionary that will say that the word the user entered is valid or not... i mean... i really cant understand the fileReader from the API.... huhu... need help...

2007-01-28 23:34:02 · 3 answers · asked by Anonymous in Computers & Internet Programming & Design

3 answers

FileReader fr = new FileReader("D:/myfile.txt");
if(fr.ready()){

fr.read() //reads one character at a time
}
fr.close();

You have to use a while loop to read more than one character

2007-01-28 23:58:09 · answer #1 · answered by Vishal H 2 · 0 0

Have a look at the examples in the tutorial: http://home.cogeco.ca/~ve3ll/jatutor8.htm

You'll also probably want to use readln() to read full lines instead of read() to read character by character.

2007-01-29 03:11:55 · answer #2 · answered by Dr.Mr.Ed 5 · 0 0

www.pekiyi.150m.com/java.html

2007-01-28 23:44:11 · answer #3 · answered by iyiogrenci 6 · 0 0

fedest.com, questions and answers