Chapter 10 Flashcards

1
Q

In object-oriented programming terminology, an unexpected or error condition is a(n)

A

Exception

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

All Java Exceptions are

A

Throwable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Errors are ______ serious than Exceptions

A

more

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The method that ends the current application and returns control to the operating system is

A

System.exit()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In object-oriented terminology, you _______ a procedure that might not complete correctly.

A

Try

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

A method that detects an error condition or Exception _______ an Exception.

A

Throws

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A try block includes

A

The keyword try, curly braces, and statements that might cause Exceptions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

The segment of code that handles or takes appropriate action following an Exception is a _____ block.

A

Catch

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

You ______ within a try block.

A

Can place any number of statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

If you include three statements in a try block and follow the block with three catch blocks, and the second statement in the try block throws an Exception, then

A

The first matching catch block executes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

When a try block does not generate an Exception and you have included multiple catch blocks,

A

No catch blocks execute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

The catch block that begins catch(Exception e) can catch Exceptions

A

For both IOExceptions andArithmeticExceptions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

The code within a finally block executes

A

Whether or not the try block identifies any Exceptions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

An advantage to using a try… catch block is that exceptional events are

A

Isolated from regular events

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Methods that can throw an Exceptions

A

Any method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

When a method throws an Exception and does not catch it, the Exception

A

Is thrown to the next method to be called, if there is one

17
Q

What are used if you want to use a method to its full potential?

A

The type of arguments the method requires

18
Q

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

A

Call stack

19
Q

You can get a list of the methods through which an Exception has traveled by using the _______ method.

A

PrintStackTrace()

20
Q

An _______ is a statement used in testing programs that should be true; if it is not true, an Exception is thrown.

A

Assertion