Java Chapter 11: Exceptions and Advanced File I/O
This is an internal list of all methods that are currently executing.
Call stack
If your code does not handle an exception when it is thrown, it is dealt with by this.
Default exception handler
This is a section of code that gracefully responds to exceptions.
Exception handler
TRUE/FALSE: IOException serves as a superclass for exceptions that are related to programming errors, such as an out-of-bounds array subscript.
False
TRUE/FALSE: The throws clause causes an exception to be thrown.
False
TRUE/FALSE: When an exception is thrown by code inside a try block, all of the statements in the try block are always executed.
False
TRUE/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
FileNotFoundException inherits from
IOException
All exception classes inherit from this class.
Throwable
When an exception is generated, it is said to have been
Thrown
TRUE/FALSE: Not including polymorphic references, a try statement can have only have one catch clause for each specific type of exception.
True
TRUE/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 it's compatible with the exceptions.
True
TRUE/FALSE: You are not required to catch exceptions that inherit from the RuntimeException class.
True
TRUE/FALSE: You cannot have more than one catch clause per try statement.
False
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.
Finally Block
The numeric wrapper classes' "parse" methods all throw an exception of this type.
NumberFormatException
This is the process of converting an object to a series of bytes that represent the object's data.
Serialization
You can think of this code as being "protected" because the application will not halt if it throws an exception.
Try block
All exceptions that do not inherit from the Error class or the RunTimeException class are _____.
checked exceptions
This method can be used to retrieve the error message from an exception object
getMessage
This informs the compiler of the exceptions that could get throw from a method.
throws clause
These are exceptions that inherit from the Error class or the RuntimeException class.
unchecked exceptions
This method may be called from any exception object, and it shows the chain of methods that were called when the exception was thrown.
printStackTrace
You use this statement to throw an exception manually
throw