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
Q44: Consider the following code snippet: try<br>{<br>PrintWriter outputFile
Q45: Insert the missing code in the following
Q46: Insert the missing code in the following
Q47: Consider the following code snippet. File inputFile
Q48: Which method of the JFileChooser object will
Q50: In the hierarchy of Exception classes, the
Q51: Insert the missing code in the following
Q52: Insert the missing code in the following
Q54: Consider the following code snippet: Scanner in
Q106: Which of the following statements about checked