If you look at my code below, can you tell me what is happening when I make a static FileReader file, then set file = new FileReader(fileName) each time I open a file. Does it make sense for FileReader file to be static? I realize that by making file static, I will only ever have one instance of file, but is this efficient or smart coding?
Thanks,
Eric
private static BufferedReader reader;
private static FileReader file;
private List list = new LinkedList();
private WTFRParseFile() {
}
private static WTFRParseFile wtfr = new WTFRParseFile();
public static WTFRParseFile makeWTFR() {
return wtfr;
}
public void openFile(
String fileName) throws FileNotFoundException, IOException {
file = new FileReader(fileName);
reader = new BufferedReader(file);
}
[ April 17, 2006: Message edited by: Eric Gero ]