Question: How I can create method call to run this ( this method should open file ) suing have public static BufferedReader openFile(String prompt)t BufferedReader br

How I can create method call to run this ( this method should open file ) suing haveHow I can create method call to run this ( this method

public static BufferedReader openFile(String prompt)t BufferedReader br = null; boolean error = true; while(error)t tryt System.out.println(prompt); string fileName new Scanner(System.in).nextLine(); FileInputStream fis new FileInputStream(fileName); InputStreamReader isr = new InputStreamReader(fis) br = new BufferedReader(isr); error = false; catch(FileNotFoundException ex) System.out.println("File name you entered could not be opened...In Make sure that the file exists"); error true; return br

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 Databases Questions!