Thanks. So the example you gave, can have br.close() in finally block.
try {
URL url = new URL(some_path);
File file = new File(url.toURI());
BufferedReader br = new BufferedReader(
new InputStreamReader(
new FileInputStream(file)));
// read and process file
} catch(MalformedURLException mue) {
System.out.println("Bad URL: " + mue.getMessage());
} catch(FileNotFoundException fnfe) {
System.out.println("FileNotFound: " + fnfe.getMessage());
} catch(IOException ioe) {
System.out.println("Read error: " + ioe.getMessage());
}
finally{
br.close();
}
And what I know is, the finally block will execute even if no exception is caught. Is this right?