05 Exception Handling Flashcards

1
Q

What exception is used when accessing an invalid index (character) of a string?

A

StringIndexOutOfBoundsException

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

Exceptions that occur during execution.

A

Unchecked exceptions

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

What exception is used when the class is not found?

A

ClassNotFoundException

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

It contains statements which are executed whether or not an exception is thrown.

A

finally block

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

Exceptions that occur during compilation.

A

Checked exceptions

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

What exception is used when accessing an invalid index of the array?

A

ArrayIndexOutOfBoundsException

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

What exception is used when there is an error, such as an integer divided by 0?

A

Arithmetic Exception

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

It is created by extending the Exception class.

A

user-defined exception

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

There can be multiple catch blocks. True or False?

A

True

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

It is the process used to change the normal flow of code of execution if a specifies exception occurs.

A

Exception handling

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

It sends an exception out of a block or a method so it can be handled elsewhere.

A

throw statement

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

What exception is used when there is an invalid conversion of a string to a numeric format?

A

NumberFormatException

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

What exception is used when entering a value that does not match the expected data type?

A

InputMismatchException

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

It is a block of code that might throw an exception that can be handles by a matching catch block.

A

Try block

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

What exception is used when the access to a class is denied?

A

IllegalAccessException

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

There can be multiple finally blocks after a try-catch structure. True or False?

A

False.

17
Q

It is a method that can be used to determine Java’s message about the exception.

A

getMessage()

18
Q

What exception is used when a requested method does not exist?

A

NoSuchMethodException

19
Q

It is an event that occurs during the execution of a program that disrupts the normal flow of instruction.

A

Exception

20
Q

It is a segment of code that can handle an exception that might be thrown by the try block that precedes it.

A

Catch block

21
Q

What exception is used when there is an invalid use of a null reference?

A

NullPointerException

22
Q

What exception is used when the attempt to create an object of an abstract or an interface?

A

InstatiationException

23
Q

Assigning a value to an array index that does not match the expected data type.

A

ArrayStoreException