Inside a method, if any exception occurs the method in which it arises is responsible for creating exception objects by including the following information:
Name of exception
Description of exception
Location at which exception occurs[stackTrace]
Default exception handler prints exception information in the following format and terminates program abnormally:
Name of exception
Description of exception
Location at which exception occurs[stackTrace]
Default exception handler prints exception information in the following format and terminates program abnormally:
- Exception in thread “main” Name of exception:Descriptions StackTrace
- Exception in thread “xxx” Name of exception:Descriptions StackTrace
- Here, xxx will be any method.