Add These Flashcards
Error
Similar to an exception, except that an error generally represents an unrecoverable situation and should not be caught.
Exception
An object that defines an unusual or erroneous situation.
try-catch Statement
Identifies a block of statements that may throw an exception.
catch clause
Follows a try block and defines how a particular kind of exception is handled.
Also called an exception handler
exception handler
Follows a try block and defines how a particular kind of exception is handled.
Also called a catch clause.
finally clause
An optional end to a try-catch statement.
Defines a section of code that is executed no matter how the try block is exited.
exception propagation
If an exception is not caught and handled in the method where it occurs, control is immediately returned to the method that invoked the method that produced the exception. If it isn’t caught there, control returns to method that called it, and so on until it is passed out of the main method and then the program is terminated.
Errors
LinkageError
ThreadDeath
VirtualMachineError
AWTError
Exceptions
IllegalAccessException
NoSuchMethodException
ClassNotFoundException
RuntimeExceptions
ArithmeticException
IndexOutOfBoundsException
NullPointerException
checked exception
Must either be caught by a method or be listed in the throws clause of any method that may throw or propagate it.
throws clause
Appended to the header of a method definition to formally acknowledge that the method will throw or propagate a particular exception if it occurs.
unchecked exception
Requires no throws clause. The only unchecked exceptions in Java are objects of the type RuntimeException or any of its descendants: ArithmeticException IndexOutOfBoundsException NullPointerException
Abstraction
Hides certain data types at certain times.
Data Type
A group of values and the operations defined on those values.