Question: String fileName is read from input. Write a try block to: 2 Assign filelnStream with a new FilelnputStream that opens the file named fileName for
String fileName is read from input. Write a try block to:
Assign filelnStream with a new FilelnputStream that opens the file named fileName for reading.
Assign fScanner with a Scanner created using filelnStream.
Read the next floatingpoint number from the file into valueRead.
Ex: If the input is width txt then the output is:
Value read from widthtxt:
Ex: If the input is badfil txt then the output is:
Error opening file: badfile.txt
tablewidthtxtwidthtxt
fileName scnrnext ;
Your code goes here
catch FileNotFoundException e
errorFound true;
if fScanner null
fScanner. close;
if errorfound
System, out.printlnError opening file: fileName;
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
