The Java runtime system catches it.
The Java runtime system catches exceptions that have been thrown to it,
just as your code can
do with a catch{}
block
The runtime system prints out a message and a stack trace using data in the exception.
Here is a list of some exception types,
with the checked exceptions indicated.
Only RunTimeException
and its subclasses are not checked.
The parent class, Exception
is checked.
Exception CHECKED IOException CHECKED AWTException CHECKED RunTimeException ArithmeticException IllegalArgumentException NumberFormatException IndexOutOfBoundsException ArrayIndexOutOfBoundsException NoSuchElementException InputMismatchException Others Others CHECKED
(Review: ) What are two ways your code can handle a checked exception?