Solved

Insert the Missing Code in the Following Code Fragment

Question 3

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:

verifed

Verified

Related Questions