Exam 12: Exception Handling

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

A(n) ____ is a Java language feature that can help you detect logical errors that do not cause a program to terminate, but nevertheless produce incorrect results.

(Multiple Choice)
4.7/5
(42)

Match each term with the correct statement below. -The parent class of Exception

(Multiple Choice)
4.9/5
(37)

Since variables declared within a try or catch block are local to that block, the variable goes out of scope when the try or catch block ends.

(True/False)
4.9/5
(30)

To use a method to its full potential, you must know the method name, return type, type and number of arguments required, and type and number of exceptions the method throws.

(True/False)
4.9/5
(38)

In order to use a variable both with a try or catch block and afterward, you must declare the variable before the ____ block begins.

(Multiple Choice)
4.9/5
(46)

What is unreachable code and how might using multiple catch blocks cause this? Provide an example.

(Essay)
4.8/5
(37)

If a method throws an exception that it will not catch but that will be caught by a different method, you must also use the keyword ____ followed by an Exception type in the method header.

(Multiple Choice)
4.8/5
(34)

When a program contains multiple ____ blocks, they are examined in sequence until a match is found for the type of exception that occurred.

(Multiple Choice)
4.8/5
(38)

What is a finally block and how would a programmer use it?

(Essay)
4.8/5
(40)

Match each term with the correct statement below. -Applications designed so that they continue to operate when some part of the system fails

(Multiple Choice)
4.8/5
(37)

When a constructor throws an exception, no object is constructed; its intended reference variable value will be ____.

(Multiple Choice)
4.7/5
(45)

Match each term with the correct statement below. -A language feature designed to make it harder to write bad code

(Multiple Choice)
4.8/5
(34)

Assertions are meant to be helpful in the ____ stage of a program.

(Multiple Choice)
4.7/5
(39)

What is the first program statement in a catch block?

(Multiple Choice)
4.9/5
(44)

To create your own throwable Exception class, you must extend a subclass of Catchable.

(True/False)
4.8/5
(34)

How is an Error class different from an Exception class?

(Essay)
4.7/5
(32)

Many developers believe that it is poor style for a method to throw more than ____ type(s) of exceptions.

(Multiple Choice)
4.9/5
(34)

Match each term with the correct statement below. -A block of code you attempt to execute while acknowledging that an exception might occur

(Multiple Choice)
4.8/5
(37)

You can place as many statements as you need within a try block, and you can catch as many exceptions as you want.

(True/False)
4.9/5
(33)

The memory location known as the ____________________ is where the computer stores the list of method locations to which the system must return.

(Short Answer)
4.7/5
(36)
Showing 21 - 40 of 65
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)