wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Java Chapter 11 Review Questions

Total questions: 24

Worksheet time: 12mins

Name
Class
Date
1.

When an exception is generated, it is said to have been...

a)

built

b)

thrown

c)

caught

d)

killed

2.

This is a section of code that gracefully responds to exceptions

a)

exception generator

b)

exception manipulator

c)

exception handler

d)

exception monitor

3.

If your code does not handle an exception when it is thrown, it is dealt with by this.

a)

default exception handler

b)

the operating system

c)

system debugger

d)

default exception generator

4.

All exception classes inherit from this class

a)

Error

b)

RuntimeException

c)

JavaException

d)

Throwable

5.

FileNotFoundException inherits from:

a)

Error

b)

IOException

c)

JavaException

d)

FileException

6.

You can think of this code as bein "protected" because the application will not halt if it throws an exception

a)

try block

b)

catch block

c)

finally block

d)

protected block

7.

This method can be used to retrieve the error message from an exception object.

a)

errorMessage

b)

errorString

c)

getError

d)

getMessage

8.

The numeric wrapper classes' "parse" methods all throw an exception of this type

a)

ParseException

b)

NumberFormatException

c)

IOException

d)

BadNumberException

9.

This is one or more statements that are always executed after the try block has executed and after any catch blocks have executed if an exception was thrown.

a)

try block

b)

catch block

c)

finally block

d)

protected block

10.

This is an internal list of all methods that are currently executing.

a)

invocation list

b)

call stack

c)

call list

d)

list trace

11.

This method may be called from any exception object, and it shows the chain of methods that were called when the exception was thrown

a)

printInvocationList

b)

printCallStack

c)

printStackTrace

d)

printCallList

12.

These are exceptions that inherit from the Error class or the RuntimeException class

a)

unrecoverable exceptions

b)

unchecked exceptions

c)

recoverable exceptions

d)

checked exceptions

13.

All exceptions that do not inherit from the Error class or the RuntimeException class are:

a)

unrecoverable exceptions

b)

unchecked exceptions

c)

recoverable exceptions

d)

checked exceptions

14.

This informs the compiler of the exceptions that could get thrown from a method

a)

throws clause

b)

parameter list

c)

catch clause

d)

method return type

15.

You use this statement to throw an exception manually.

a)

try

b)

generate

c)

throw

d)

System.exit(0)

16.

This is a process of converting an object to a series of bytes that represent the object's data

a)

serialization

b)

deserialization

c)

dynamic conversion

d)

casting

17.

You are not required to catch exceptions that inherit from the RuntimeException class

a)

True

b)

False

18.

When an exception is thrown by code inside a try block, all of the statements in the try block are always executed

a)

True

b)

False

19.

IOException serves as a superclass for exceptions that are related to programming errors, such as an out-of-bound array subscript.

a)

True

b)

False

20.

You cannot have more than one catch clause per try statement

a)

True

b)

False

21.

When an exception is thrown, the JVM searches the try statement's catch clauses from top to bottom and passes control of the program to the first catch clause with a parameter that is compactible with the exception.

a)

True

b)

False

22.

Not including polymorphic references, a try statement may have only one catch clause for each specific type of exception

a)

True

b)

False

23.

When in the same try statement you are handling multiple exceptions and some of the exceptions are related to each other through inheritance, you should handle the more general exception classes before the more specialized exception classes.

a)

True

b)

False

24.

The throws clause causes an exception to be thrown

a)

True

b)

False