Question: java String widthFileName is read from input. Write a try block to: Assign fileInStream with a new FileInputStream that opens the file named widthFileName for
java String widthFileName is read from input. Write a try block to:
Assign fileInStream with a new FileInputStream that opens the file named widthFileName for reading.
Assign fScanner with a Scanner created using fileInStream.
Read the next floatingpoint number from the file into widthValue.
Ex: If the input is widthtxt then the output is:
Value read from widthtxt:
Ex: If the input is badfile.txt then the output is:
badfile.txt: Error occurred
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
