What is the difference between error and an exception?1. Errors are abnormal conditions that should never occur. Not to be confused with the compile time errors.
2. A method is not required to declare in its throws clause any subclasses of Error that might be thrown during the execution of the method but not caught.
3. An exception is a condition that a programmer has already predicted. These can be caught unlike errors. They occur due to bad input, etc.
|