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
Q18: Insert the missing code in the following
Q19: Consider the following code snippet. File hoursFile
Q20: Consider the following code snippet: File inputFile
Q21: Which of the following statements about reading
Q22: Insert the missing code in the following
Q24: Insert the missing code in the following
Q25: Which of the following statements about reading
Q26: Which return value of the JFileChooser object's
Q27: Your program must read in an existing
Q28: Consider the following code snippet. PrintWriter outputFile
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents