Solved

Insert the Missing Code in the Following Code Fragment

Question 85

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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents