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
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
Q31: Which of the following statements about exception
Q48: Which method of the JFileChooser object will
Q56: Which of the following statements about white
Q68: Your program must read in an existing
Q98: When you start a Java program from
Q103: When reading words using a Scanner object's