F
farah_omarshah
Hi,
Ive written some code to feed a text file (a list of words) into a
program, as is shown below. My dilemma is how to get the program to
take the words in the text file and store them in a hash set. I need to
do this in order to later compare two lists of words.....can anyone
point me me in the right direction please??
import java.io.*;
public class FileIn {
BufferedReader in;
public FileIn() {
try {
in = new BufferedReader(new FileReader("\\C:\\Program
Files\\java.txt\\"));
String line = in.readLine();
System.out.println(line);
in.close();
} catch(IOException ioe) {
System.out.println(ioe.toString());
}
}
public static void main(String args[]) {
FileIn newFile = new FileIn();
}
}
Ive written some code to feed a text file (a list of words) into a
program, as is shown below. My dilemma is how to get the program to
take the words in the text file and store them in a hash set. I need to
do this in order to later compare two lists of words.....can anyone
point me me in the right direction please??
import java.io.*;
public class FileIn {
BufferedReader in;
public FileIn() {
try {
in = new BufferedReader(new FileReader("\\C:\\Program
Files\\java.txt\\"));
String line = in.readLine();
System.out.println(line);
in.close();
} catch(IOException ioe) {
System.out.println(ioe.toString());
}
}
public static void main(String args[]) {
FileIn newFile = new FileIn();
}
}