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
Q8: Consider the following code snippet:<br>Public static void
Q9: Insert the missing code in the following
Q13: Consider the following code snippet:<br>Public void readFile(String
Q15: Which of the following statements about checked
Q16: Insert the missing code in the following
Q17: You wish to use the Scanner class's
Q19: Consider the following code snippet: Scanner in
Q43: Which of the following is the correct
Q56: Which of the following statements about white
Q85: Which of the following statements about reading