Skip to content

Instantly share code, notes, and snippets.

@TomTasche
Created August 11, 2011 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TomTasche/1139442 to your computer and use it in GitHub Desktop.
Save TomTasche/1139442 to your computer and use it in GitHub Desktop.
Auto-closing objects in Java 7
try (InputStreamReader reader = new InputStreamReader(null);
BufferedReader buffReader = new BufferedReader(null)) {
// do something
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment