Question: [ 1 pts ] A method named openFile ( ) that takes as the input parameter a file name of type String. This method will

[1pts] 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 openFile(String filename){...}
For example, with the file name input.txt the method will try to open the file input.txt 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!