Multiple Choice
Consider the following code snippet:
Try
{
PrintWriter outputFile = new PrintWriter(filename) ;
Try
{
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 the exception occurs.
B) The file will be closed if the PrintWriter constructor throws an exception.
C) The file will be closed 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
Q5: When writing a method, which of the
Q41: Which return value of the JFileChooser object's
Q66: Which of the following statements about reading
Q70: Insert the missing code in the following
Q77: Insert the missing code in the following
Q78: Consider the following code snippet: Scanner in
Q83: Consider the following code snippet: File inputFile
Q89: Which of the following statements about reading
Q91: Under which condition will the Scanner constructor
Q95: Which of the following is the correct