try {
FileReader fr = new FileReader(file);
BufferedReader br = new BufferedReader(fr);
String line = null;
} catch (FileNotFoundException fnf) {
fnf.pri
You have a problem with your scopes. If you really want to use that syntax you should fix it like this:
FileReader fr = null;
try {
fr = new FileReader(file);
BufferedReader br = new BufferedReader(fr);
String line = null;
} catch (FileNotFoundException fnf) {
fnf.printStackTrace();
} finally {
if( fr != null)
fr.close();
}
that way, fr will exist in the finally's block scope.