Skip to content

Instantly share code, notes, and snippets.

@nwillc
Last active October 25, 2018 02:53
Show Gist options
  • Save nwillc/16d0a1bfeed0e551056541967c66251a to your computer and use it in GitHub Desktop.
Save nwillc/16d0a1bfeed0e551056541967c66251a to your computer and use it in GitHub Desktop.
Old Java exception handling
Reader reader = null;
try {
reader = new FileReader("input.txt");
// Use the input
} catch (FileNotFoundException e) {
// Handle possible exception
} catch (IOException e2) {
// Handle another exception
} finally {
if (reader != null) {
readert.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment