Sie sind auf Seite 1von 7

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

a. built
b. thrown
c. caught
d. killed
thrown
This is a section of code that gracefully responds to exceptions.
a. exception generator
b. exception manipulator
c. exception handler
d. exception monitor
exception handler
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
default exception handler
All exception classes inherit from this class.
a. Error
b. RuntimeException
c. JavaException
d. Throwable
Throwable
FileNotFoundException inherits from ____
a. Error
b. IOException
c. JavaException
d. FileException
IOException
You can think of this code as being "protected" because the application will
not halt if it throws an exception.
a. try block
b. catch block
c. finally block
d. protected block
try block
This method can be used to retrieve the error message from an exception
object.
a. errorMessage
b. errorString
c. getError
d. getMessage
getMessage
The numeric wrapper classes' "parse" methods all throw an exception of this
type.
a. ParseException
b. NumberFormatException
c. IOException
d. BadNumberException
NumberFormatException
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
finally block
This is an internal list of all the methods that are currently executing.
a. invocation list
b. call stack
c. call list
d. list trace
call stack
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
printStackTrace
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
unchecked exceptions
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
checked exceptions
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
throws clause
You use this statement to throw an exception manually.
a. try
b. generate
c. throw
d. System.exit(0)
throw
This is the 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
serialization
True or False:
You are not required to catch exceptions that inherit from the
RuntimeException class.
True
True or False:
When an exception is thrown by code inside a try block, all of the statements
in the try block are always executed.
False
When an exception is thrown the method stops execution right after the
"throw" statement. Any statements following the "throw" statement are not
executed.
True or False:
IOException serves as a superclass for exceptions that are related to
programming errors, such as an out-of-bounds array subscript.
False
the RuntimeException serves as a superclass for exceptions that are related
to programming errors, such as an out-of-bounds array subscript.
True or False:
You cannot have more than one catch clause per try statement.
False
a try statement can have more than one catch clause for each specific type of
exception
True or False:
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 compatible with the exception.
True
True or False:
Not including polymorphic references, a try statement may have only one
catch clause for each specific type of exception.
True
True or False:
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.
False
you should handle the more specialized exception classes before the more
general exception classes.
True or False:
The throws clause causes an exception to be thrown.
False
the "throws" clause informs the compiler that the method throws one or more
exceptions