Multiple Choice
Consider the following code snippet, assuming that filename represents the name of the output file and writeData outputs the data to that file: Which of the following statements about this code is correct?
A) The close method of the outputFile object will be automatically invoked when the try block ends, but only if no exception occurred.
B) The program will terminate with an unhandled exception if the PrintWriter constructor fails.
C) The close method of the outputFile object will be automatically invoked when the try block ends, whether or not an exception has occurred.
D) The close method of the outputFile object will be automatically invoked when the try block ends, but only if an exception occurs.
Correct Answer:

Verified
Correct Answer:
Verified
Q7: Consider the following code snippet: <img src="https://d2lvgg3v3hfg70.cloudfront.net/TB7392/.jpg"
Q8: Which method of an exception object will
Q9: Which of the following statements about exception
Q10: Consider the following code snippet:<br>File inputFile =
Q11: Consider the following code snippet.<br>File hoursFile =
Q13: Consider the following code snippet, where data
Q14: Consider the following code snippet: <img src="https://d2lvgg3v3hfg70.cloudfront.net/TB7392/.jpg"
Q15: Which of the following statements about checked
Q16: Complete the code fragment below, which is
Q17: Assume inputFile is a Scanner object used