Quiz
Although this hour is literally filled with errors, see whether you can answer the following questions about them without making any errors of your own.
Questions
1: |
How many exceptions can a single catch statement handle?
- Only one
- Several different exceptions
- This answer intentionally left blank.
|
2: |
When will the statements inside a finally section be run?
- After a try-catch block that has ended with an exception
- After a TRy-catch block that has ended without an exception
- Both
|
3: |
With all this talk about throwing and catching, what do the Texas Rangers need to do in the off-season?
- Get some more starting pitching
- Sign a left-handed power-hitting outfielder who can reach the short porch in right
- Bring in some new middle relievers
|
Answers
A1: |
b. An Exception object in the catch statement can handle all exceptions of its own class and its superclasses.
|
A2: |
c. The statement or statements in a finally section always are executed after the rest of a try-catch block, whether or not an exception has occurred.
|
A3: |
a. Every answer is correct, but a. is more correct than the others, and will probably be correct for the next 30 years.
|
|