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() throws IOException
{
File inputFile = new File(. . .) ;
Scanner in = new Scanner(inputFile) ;
Try
{
While (in.hasNext() )
{
) . .
}
}
Finally
{
___________________
}
}
A) catch (IOException exception)
B) catch (FileNotFound exception)
C) catch (IllegalArgumentException exception)
D) in.close()
Correct Answer:

Verified
Correct Answer:
Verified
Q20: Which method of an exception object will
Q30: Consider the following code snippet. Scanner inputFile
Q34: Which String class method will remove spaces
Q36: You have opened a command prompt window
Q37: Consider the following code snippet:<br>Throw new IllegalArgumentException("This
Q42: Insert the missing code in the following
Q62: Insert the missing code in the following
Q93: Which of the following statements reflects the
Q94: An example of a fatal error that
Q106: Which of the following statements about checked