Created
October 25, 2018 00:23
-
-
Save nwillc/d82f487d8c953e76a82d5d1af95245f5 to your computer and use it in GitHub Desktop.
Try with resources
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try (Reader reader = new FileReader("input.txt")) { | |
// Use the input | |
} catch (FileNotFoundException e) { | |
// Handle possible exception | |
} catch (IOException e2) { | |
// Handle another exception | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment