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
Q98: Consider the following code snippet: public void
Q99: Which of the following statements about the
Q100: Which of the following statements about exception
Q101: Consider the following code snippet: try
{
PrintWriter outputFile
Q102: Insert the missing code in the following
Q104: Consider the following code snippet: Scanner in
Q105: Consider the following code snippet: try
{
File inputFile
Q106: Consider the following code snippet written in
Q107: Consider the following code snippet: try
{
PrintWriter outFile
Q108: Select the missing expression in the code
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