Save
Freshman
CP2
05
Save
Share
Learn
Content
Leaderboard
Learn
Created by
Joshua
Visit profile
Cards (12)
Exception
An event that occurs during the execution of a program that
disrupts
the
normal flow
of instructions
View source
Exception handling
The process used to change the
normal flow
of
code execution
if a specified exception occurs
View source
Checked exceptions
ClassNotFoundException
IllegalAccessException
InstantiationException
NoSuchMethodException
View source
Unchecked (runtime) exceptions
ArithmeticException
ArrayIndexOutOfBoundsException
ArrayStoreException
InputMismatchException
NullPointerException
NumberFormatException
StringIndexOutOfBoundsException
View source
try block
A block of code that might throw an exception that can be handled by a matching catch block
View source
catch block
A segment of code that can handle an exception that might be thrown by the
try block
that precedes it
View source
The
getMessage()
method can be used to determine Java's message about the
exception
View source
Only one (
1
) try block is accepted in a program but there can be
multiple
catch blocks
View source
User-defined exception
Created by
extending
the
Exception
class
View source
finally block
Contains
statements
which are executed whether or not an
exception
is thrown
View source
There can only be one (1) finally block after a
try-catch
structure but it is
not
required
View source
A
throw
statement sends an exception out of a block or a method so it can be handled elsewhere
View source