Please enable JavaScript.
Coggle requires JavaScript to display documents.
Understanding Exception (Throwing an Exception (RuntimeException (Subclass…
Understanding Exception
Introduction
Exception is an error
That Java cannot handle it
Understanding Exception Types
Exception alters program flow
Categories of Exception
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.Error
Checked Exception
Have to throw or handle it
Unchecked (Runtime) Exception
Don't need to handle or throw it
Throwing an Exception
Tip
Pay attention ArrayIndexOfBound
throw new Exception();
Must to explicitly request Java to throw
RuntimeException
Subclass of RuntimeException
Catch - OK
Not Handle or declare
Checked Exception
Catch - OK
Have to Handle or declare
Subclass of Exception
Error
Catch - Not
Not Handle or declare
Subclass of Error