Question: String daikonFileName is read from input. The try block opens a file named daikonFileName to read an integer into daikonVal. Write an exception handler to
String daikonFileName is read from input. The try block opens a file named daikonFileName to read an integer into daikonVal.
Write an exception handler to catch a FileNotFoundException. In the catch block, output "Error opening file: followed by daikonFileName. End with a newline.
After the catch block, close daikonInScanner if daikonInScanner is open.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
