Question: These are 6 Java multiple choice questions. `1.)The catch clause: a.) follows the try clause b.) starts with the word catch followed by a parameter
These are 6 Java multiple choice questions.
`1.)The catch clause:
| 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 |
8.)If the program does not handle an unchecked exception:
| a.) | the program is halted and the default exception handler handles the exception | |
| b.) | the program must handle the exception | |
| c.) | the exception is ignored | |
| d.) | this will cause a compilation error |
9.)What will the following code display? 
| a.) | 997 | |
| b.) | 0 | |
| c.) | 1 | |
| d.) | 99 |
10.)If the IOData.dat file does not exist, what will happen when the following statement is executed? 
| a.) A FileNotFoundException will be thrown. | ||
| b.) | An IOExcepton will be thrown. | |
| c.) | The file IOData.dat will be created. | |
| d.) | 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:
| a.) | File and Scanner | |
| b.) | BinaryFileWriter and BinaryDataWriter | |
| c.) | FileOutputStream and DataOutputStream | |
| d.) | 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 | ||
| b.) | 2, 3, 1, 4 | |
| c.) | 4, 3, 2, 1 | |
| d.) | 3, 1, 2, 4 |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
