Solved

Rewrite the Following Method Using Try and Catch Statements Instead

Question 24

Essay

Rewrite the following method using try and catch statements instead of the throws clause in the method's header.
public String getInput(String filename) throws IOException
{
BufferedReader infile = new BufferedReader(new FileReader(filename));
String response = infile.readLine( );
infile.close( );
return response;
}

Correct Answer:

verifed

Verified

public String getInput(String filename)
...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions