Thursday, 16 April 2020

SE - 49 - Difference between Errors and Exceptions in JAVA

Errors is some serious problem in code which should not be handled in try catch while Exception is something which can be handled by try-catch block.

Major Differences :

1. All Errors are Unchecked but not all exceptions are unchecked

2. Errors can not be recovered or handled by try-catch but exceptions can be handled.

3. Exceptions are related to application where as Errors are related to environment in which application is running.

4. Checked Exceptions are known to compiler but errors are not

No comments:

Post a Comment