Skip to Content
Sun
Java
Solaris
Communities
My SDN Account
Join SDN
»
search tips
APIs
Downloads
Products
Support
Training
Participate
Developers Home
>
Products & Technologies
>
Java Technology
>
Reference
>
Code Samples and Apps
>
Index of Code Samples
>
Code sample
Error Handling Code Samples
Print-friendly Version
The Java programming language provides a flexible error handling model.
ListOfNumbers.java
shows how to use a
try
and
catch
block to catch exceptions. For supporting information see
The Java Tutorial: Handling Errors Using Exceptions
.
ListOfNumbersWOHandler.java
demonstrates how the compiler handles runtime and checked exceptions differently. A program must handle checked exceptions, but does not have to handle runtime exceptions. For supporting information see
The Java Tutorial: Handling Errors Using Exceptions
.