Please enable JavaScript.
Coggle requires JavaScript to display documents.
Java Exception - Coggle Diagram
Java Exception
Types
-
Unchecked Exception
runtime exceptions, are not checked at compile-time.
-
throw
-
-
If we throw unchecked exception from a method, it is must to handle the exception or declare in throws clause.
Exception Propagation
-
definition
An exception is first thrown from the top of the stack and if it is not caught, it drops down the call stack to the previous method. If not caught there, the exception again drops down to the previous method, and so on until they are caught or until they reach the very bottom of the call stack.
By default, Checked Exceptions are not forwarded in calling chain
-
Multi-catch block
-
All catch blocks must be ordered from most specific to most general, i.e. catch for ArithmeticException must come before catch for Exception.
finally block
block used to execute important code such as closing the connection, etc.
-
throws
-
Checked exception only should be declared, because:
-
-
-
-