javadoc中对error描述如下:
An Error is asubclass of Throwable that indicates serious problems that a reasonableapplication should not try to catch. Most such errors are abnormal conditions.
error是Throwable的子类,error的出现预示应用程序出现了严重的错误,不应该试图去catch它,因为大多数error是在非正常的情况下出现的。
Exception分受检异常(checked exception)和非受检异常(unchecked exception - RuntimeException)
受检异常需要try-catch或者在方法体声明throw
非受检异常不需要try-catch或者在方法体声明throw