1/19
Vocabulary flashcards covering core Java Exception handling concepts, methods, keywords, and hierarchies.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Exception
An event or problem that arises during the execution of a program, causing the normal flow of the program to be disrupted and terminating the application abnormally if not handled.
Checked Exceptions
Exceptions checked (notified) by the compiler at compilation-time, also known as compile time exceptions, which must be handled or declared by the programmer.
Unchecked Exceptions
Exceptions that occur at execution time, also called Runtime Exceptions, including programming bugs such as logic errors or improper API use; they are ignored during compilation.
Errors
Abnormal conditions and severe failures that arise beyond the control of the user or programmer (e.g., stack overflow or JVM out of memory) from which programs typically cannot recover.
Throwable Class
The top-level class in the Java exception hierarchy from which both Exception and Error classes derive, which itself extends java.lang.Object.
java.lang.Exception Class
A subclass of Throwable that serves as the parent class for exceptions, having two main subclasses: IOException and RuntimeException.
getMessage()
A method in the Throwable class that returns a detailed message string about the exception that has occurred, initialized in the Throwable constructor.
getCause()
A method in the Throwable class that returns the cause of the exception as represented by a Throwable object.
toString()
A method in the Throwable class that returns the name of the class concatenated with the result of getMessage().
printStackTrace()
A method in the Throwable class that prints the result of toString() along with the stack trace to System.err, the error output stream.
getStackTrace()
A method in the Throwable class that returns an array containing each element on the stack trace, where index 0 represents the top of the call stack.
fillInStackTrace()
A method in the Throwable class that fills the stack trace of the Throwable object with the current stack trace, adding to any previous information.
Protected Code
The code placed inside a try/catch block that might generate an exception.
throws Keyword
A keyword appearing at the end of a method's signature used to declare checked exceptions that the method does not handle, postponing exception handling.
throw Keyword
A keyword used to explicitly invoke or throw an exception, either a newly instantiated one or one that was just caught.
finally Block
A block of code following a try or catch block that always executes regardless of whether an exception occurs, commonly used for cleanup statements.
try-with-resources
An exception handling feature introduced in Java 7 (automatic resource management) that automatically closes resources declared within parentheses at the end of the block.
AutoCloseable Interface
An interface that a class must implement to be used in a try-with-resources statement, causing its close() method to be invoked automatically at runtime.
JVM Exceptions
A category of exceptions or errors explicitly or logically thrown by the JVM, such as NullPointerException, ArrayIndexOutOfBoundsException, and ClassCastException.
Programmatic Exceptions
Exceptions thrown explicitly by application or API programmers, such as IllegalArgumentException and IllegalStateException.