Examlex

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;
}


Definitions:

Interest Earned

Interest Earned is the amount of interest received over a period on deposits or investments.

Invested Amount

The sum of money placed into an investment vehicle with the expectation of generating a return.

Payment Extension

A prolongation of the period over which a debt or loan is to be repaid.

Later Date Payment

A payment that is scheduled to be made after the usual due date.

Related Questions