Question: [ 1 pts ] A method named openFile ( ) that takes as the input parameter a file name of type String. This method will
pts A method named openFile that takes as the input parameter a file name of type String. This method will then
try to open the file using try catch and return a file directive of type Scanner. This file directive is null if there is
any errors occurred when the file is not found.The method definition is
public static Scanner openFileString filename
For example, with the file name inputtxt the method will try to open the file inputtxt for reading and return a
Scanner file directive to that file.
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
