Read file names from the console.
If the file does not exist (i.e. an invalid file name is given), then
catch the FileNotFoundException, display the invalid file name, and exit the program.
Close the streams.
Don't use System.exit();
Files and exceptions
- 10
Locked
Comments (3)
- Popular
- New
- Old
You must be signed in to leave a comment
LennyMan
8 January 2021, 12:08
Hint: Check the try-with-resources Statement
0
Andrew
25 February 2019, 16:26
Typo: Says "...(i.e. an valid file name is given)...
Should be "...an invalid file name..."
0
Alex Vypirailenko Java Developer at Toshiba Global Comme
25 February 2019, 17:04
Thanks. We'll get that fixed soon.
0