Multiple Choice
In the following code, assume that inputFile references a Scanner object that has been successfully used to open a file: double totalIncome = 0.0;
While (inputFile.hasNext() )
{
Try
{
TotalIncome += inputFile.nextDouble() ;
}
Catch(InputMismatchException e)
{
System.out.println("Non-numeric data encountered " +
"in the file.") ;
InputFile.nextLine() ;
}
Finally
{
TotalIncome = 35.5;
}
}
What will be the value of totalIncome after the following values are read from the file?
2) 5
8) 5
3) 0
5) 5
Abc
1) 0
A) 19.5.
B) 0.0
C) 35.5
D) 75.0
Correct Answer:

Verified
Correct Answer:
Verified
Q11: Assume that the classes BlankISBN, NegativePrice, and
Q12: If your code does not handle an
Q13: In a catch statement, what does the
Q14: To write data to a binary file,
Q15: In Java there are two categories of
Q17: All of the exceptions that you will
Q18: What will be the result of the
Q19: If the class SerializedClass contains references to
Q20: To read data from a binary file,
Q21: When you deserialize an object using the