• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/34

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

34 Cards in this Set

  • Front
  • Back

When illegal division by 0 takes place, an exception object is not created automatically by the object-oriented language application. Select one:

False

The object-oriented techniques to manage errors, such as dividing a value by 0, comprise the group of methods known as ____. Select one:

exception handling

If method A calls method B and method B throws an exception, which method will catch the exception, assuming all methods have a catch block? Select one:

method B

An ____ indicates exception types that might be thrown in the method header. Select one:

exception specification clause

The ____ block is used when the program uses data files that must be closed. Select one:

finally

When you create an exception, it is conventional to end its name with ____. Select one:

Exception

You can create your own exceptions. Select one:

True

A catch block consists of four different elements: the keyword catch, followed by parentheses that contain an exception type and identifier, statements that take action to handle the error condition, an endcatch statement, and a return statement. Select one:

False

Many well-designed programs that try code do not include any catch blocks; instead, they contain only ____. Select one:

try-finally pairs

A system of passing exceptions through the chain of calling methods has great advantages because it allows methods to handle exceptions wherever the programmer has decided it is most appropriate. Select one:

True

Dividing by 0 is an error in every programming language because it is an operation that is not defined mathematically. Select one:

True

By inheriting from the Exception class, you gain access to methods contained in the ____.Select one:

parent class

A ____ is a segment of code that can handle an exception that might be thrown by the try block that precedes it. Select one:

catch block

In Java, an ArithmeticException is a type of ____. Select one:

Exception

____ is thrown when you attempt to store an object that is the wrong data type in an array.


Select one:

ArrayTypeMismatchException

You can only place one statement within each try block. Select one:

False

A(n) ____ is an unexpected or error condition that occurs while a program is running.


Select one:

exception

In object-oriented terminology, you "____" a segment of code that might cause an error.


Select one:

try

A catch block has no return type and ____ be called directly. Select one:

cannot

To create your own throwable Exception, you usually extend a built-in ____ class. Select one:

Exception

Using a traditional error-handling method to avoid dividing by 0 prevents the error and makes the method more flexible. Select one:

False

Probably the most often used error-handling solution before object-oriented programming was to make a decision before working with a potentially error-causing value. Select one:

True

When a method in an object-oriented program causes an exception, such as dividing by 0, the method ____. Select one:

throws the exception

When a program throws an exception, you always have to deal with it.


Select one:

False

The block of code that processes an error in exception handling "____."


Select one:

catches the exception

When appropriate, specialized ____ classes provide an elegant way for you to handle error situations. Select one:

Exception

____ statements are program statements that can never execute under any circumstances.


Select one:

Unreachable code

____ is thrown when an object reference does not correctly refer to a created object.


Select one:

NullReferenceException

A(n) ____ statement indicates the end of the catch block in the pseudocode.


Select one:

endcatch

A ____ is one that sends an exception object out of a method so it can be handled elsewhere.


Select one:

throw statement

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

call stack

Exceptions can be particularly useful when you throw them from ____, which do not have a return type, so they have no other way to send information back to the calling method.


Select one:

constructors

When you create a segment of code in which something might go wrong, you place the code in an error block. Select one:

False

Methods are flexible partly because they are ____.Select one:

reusable