Multiple Choice
Insert the missing code in the following code fragment. This code is intended to open a file and handle the situation where the file cannot be found.
Public void String readFile() _________________
{
File inputFile = new File(. . .) ;
Scanner in = new Scanner(inputFile) ;
Try
{
While (in.hasNext() )
{
) . .
}
}
Finally
{
In) close() ;
}
}
A) throws IOException exception
B) throws IOException, FileNotFound
C) throws IllegalArgumentException
D) throws IOException
Correct Answer:

Verified
Correct Answer:
Verified
Q11: Consider the following code snippet:<br>Try<br>{<br>PrintWriter outputFile =
Q13: Consider the following code snippet:<br>Public void readFile(String
Q15: Which of the following statements about checked
Q17: You wish to use the Scanner class's
Q17: Insert the missing code in the following
Q31: Which of the following statements about exception
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