Created
October 25, 2018 00:30
-
-
Save nwillc/b45efd47cd6243995670b97c819f1e31 to your computer and use it in GitHub Desktop.
Java try with resources with multiple 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"); | |
Writer writer = new FileWriter("output.txt")) { | |
// Use the input and output | |
} 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