Error stop the execution of the program. You are not to be able to recover from Error using try-catch statement. For example UnsatisfiedLinkError means that JVM couln't find native language definition of a method. Your program couldn't continue without these method.
The exception shows you that something goes wrong but you could recover the state of the program, the program could continue.
Actually, any exception can be caught but some exceptions are considered unlkely to be handled successfully by a try/catch statement.
All exceptions are subclasses of Throwable. Subclasses of Error, which extends Throwable, are hardware/software errors that are usually beyond the scope of application code. Similarly, subclasses of RuntimeException, which extends Exception, which in turn extends Throwable, represent software errors (like OutOfMemoryError) that would be hard to predict in advance well enough to handle.
This leaves all subclasses of Exception that are not also subclasses of RuntimeException. These are called checked exceptions and must always be either caught by a try/catch statement or explicitly passed to the calling method by a throws clause. Checked exceptions are considered sufficiently predictable and potentially correctable that the programmer should think about handling them and show his/her decision in the code. [ October 04, 2004: Message edited by: Mike Gershman ]
SCJP 1.4, SCWCD in process
Let's go to the waterfront with this tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Java