Multiple Choice
Consider the following code snippet: try
{
PrintWriter outputFile = new PrintWriter(filename) ;
WriteData(outputFile) ;
}
Finally
{
OutputFile.close() ;
}
Catch (IOException exception)
{
) . .
}
Which of the following statements about this code is correct?
A) The file will be closed regardless of when an exception occurs.
B) The file will be closed only if the PrintWriter constructor throws an exception.
C) The file will be closed only if the writeData() statement throws an exception.
D) It is not possible to determine whether the file will be closed if an exception occurs.
Correct Answer:

Verified
Correct Answer:
Verified
Q39: Assume that inputFile is a Scanner object
Q40: Which method of an exception object will
Q41: Which return value of the JFileChooser object's
Q42: Insert the missing code in the following
Q43: Consider the following code snippet: Scanner in
Q45: Insert the missing code in the following
Q46: Insert the missing code in the following
Q47: Consider the following code snippet. File inputFile
Q48: Which method of the JFileChooser object will
Q49: Insert the missing code in the following