Chapter 10 Flashcards
In object-oriented programming terminology, an unexpected or error condition is a(n)
Exception
All Java Exceptions are
Throwable
Errors are ______ serious than Exceptions
more
The method that ends the current application and returns control to the operating system is
System.exit()
In object-oriented terminology, you _______ a procedure that might not complete correctly.
Try
A method that detects an error condition or Exception _______ an Exception.
Throws
A try block includes
The keyword try, curly braces, and statements that might cause Exceptions
The segment of code that handles or takes appropriate action following an Exception is a _____ block.
Catch
You ______ within a try block.
Can place any number of statements
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
The first matching catch block executes
When a try block does not generate an Exception and you have included multiple catch blocks,
No catch blocks execute
The catch block that begins catch(Exception e) can catch Exceptions
For both IOExceptions andArithmeticExceptions
The code within a finally block executes
Whether or not the try block identifies any Exceptions
An advantage to using a try… catch block is that exceptional events are
Isolated from regular events
Methods that can throw an Exceptions
Any method
When a method throws an Exception and does not catch it, the Exception
Is thrown to the next method to be called, if there is one
What are used if you want to use a method to its full potential?
The type of arguments the method requires
The memory location where the computer stores the list of method locations to which the system must return is known as the
Call stack
You can get a list of the methods through which an Exception has traveled by using the _______ method.
PrintStackTrace()
An _______ is a statement used in testing programs that should be true; if it is not true, an Exception is thrown.
Assertion