Exception Flashcards

(18 cards)

1
Q

An ___________ is an error or unexpected
situation that happens while the program is
running.

A

exception

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

___________ refers to techniques
that Java uses to detect, handle, and
respond to errors in a controlled way.

A

Exception handling

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

A ________ happens while the
program is running

A

runtime exception

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

A ______ is a mistake in the code structure, like missing a semicolon, and is found before the program runs (during
compilation).

A

syntax error

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

Both of these classes come from a parent
class called ____________, and like all Java
classes, they also come from the base class
Object.

A

Throwable

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

____________
Represents serious system-level problems.

A

Error Class

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

___________
Represents less serious, recoverable problems.

A

Exception Class

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

A _____ means that the program stops
running suddenly because of an error.

A

crash

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

The list of method calls shown in the error
message is called a ___________.

A

stack trace

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

What Is a Stack Trace?

It shows the ___________________
that led to the error.

A

sequence of method calls

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

A ____________ program:
Keeps running even if something goes wrong.
May reduce performance or features, but it won’t
crash.

A

fault-tolerant

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

A_________ program:
Can handle unexpected problems.
Is more reliable under stress or errors.

A

robust

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

A____________ can have many statements.

A

try block

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

_____________ if the input
is not an integer

A

InputMismatchException

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

__________ if you divide by
zero

A

ArithmeticException

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

A ____________contains code that will
always run, whether or not an
exception happens.

A

finally block

17
Q

_____________ These are expected errors that the programmer
should prepare for.

A

Checked Exceptions