Sams Teach Yourself Java 2 in 24 Hours

Sams Teach Yourself Java 2 in 24 Hours

By Rogers Cadenhead

Questions

  1. How many exceptions can a single catch statement handle?
    1. Only one
    2. Several different exceptions
    3. This answer intentionally left blank
  2. When will the statements inside a finally section be run?
    1. After a try-catch block that has ended with an exception
    2. After a try-catch block that has ended without an exception
    3. Both
  3. With all this talk about throwing and catching, what do the Texas Rangers need to do in the off-season?
    1. Get some more starting pitching
    2. Sign a left-handed power-hitting outfielder who can reach the short porch in right
    3. Bring in some new middle relievers

Answers

  1. b. An Exception object in the catch statement can handle all exceptions of its own class and its subclasses.
  2. b. 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.
  3. a. Every answer is correct, but a. is more correct than the others, and will probably be correct for the next 30 years.

Share ThisShare This

Informit Network