Multiple Choice
Insert the missing code in the following code fragment. This fragment is intended to read an input file named hoursWorked.txt. You want the program to terminate if the file does not exist. public static void main(String[] args) ______________
{
File inputFile = new File("hoursWorked.txt") ;
Scanner in = new Scanner(inputFile) ;
) . .
}
A) catch FileMissingException
B) catch FileNotFoundException
C) throws FileMissingException
D) throws FileNotFoundException
Correct Answer:

Verified
Correct Answer:
Verified
Q1: Assume that inputFile is a Scanner object
Q2: Which of the following statements about using
Q4: Consider the following code snippet: try<br>{<br>PrintWriter outputFile
Q5: When writing a method, which of the
Q6: Which of the following statements about exception
Q7: Insert the missing code in the following
Q8: Your program will read in an existing
Q9: Which Java class implements a file dialog
Q10: What is the purpose of the throw
Q11: Consider the following code snippet: Scanner in