Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

These are 6 Java multiple choice questions. `1.)The catch clause: follows the tr

ID: 3885549 • Letter: T

Question

These are 6 Java multiple choice questions.

`1.)The catch clause:

follows the try clause

starts with the word catch followed by a parameter list in parentheses containing an ExceptionType parameter variable

contains code to gracefully handle the exception type listed in the parameter list

All of these

8.)If the program does not handle an unchecked exception:

the program is halted and the default exception handler handles the exception

the program must handle the exception

the exception is ignored

this will cause a compilation error

997

0

1

99

a.) A FileNotFoundException will be thrown.

An IOExcepton will be thrown.

The file IOData.dat will be created.

This is a critical error, the program will stop execution.

11.)To write data to a binary file you create objects from the following classes:

File and Scanner

BinaryFileWriter and BinaryDataWriter

FileOutputStream and DataOutputStream

File and PrintWriter

12.)If, within one try statement you want to have catch clauses that catch exceptions of the following types, in which order should they appear in your program?

(1) Throwable
(2) Exception
(3) RuntimeException
(4) NumberFormatException

a.)4, 1, 3, 2

2, 3, 1, 4

4, 3, 2, 1

3, 1, 2, 4

a.)

follows the try clause

b.)

starts with the word catch followed by a parameter list in parentheses containing an ExceptionType parameter variable

c.)

contains code to gracefully handle the exception type listed in the parameter list

d.)

All of these

Explanation / Answer

1.)The catch clause:

Answer: d) All of these

8.)If the program does not handle an unchecked exception:

Answer: the program is halted and the default exception handler handles the exception

9.)What will the following code display?

Answer: Unable to see the image here. Please reupoad so that i can help you

10.)If the IOData.dat file does not exist, what will happen when the following statement is executed?

Answer: a.) A FileNotFoundException will be thrown.

11.)To write data to a binary file you create objects from the following classes:

Answer: c) FileOutputStream and DataOutputStream

12.)If, within one try statement you want to have catch clauses that catch exceptions of the following types, in which order should they appear in your program?

Answer:c) 4, 3, 2, 1

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote