Error Handling in Java
You cannot afford to have an application that stops working or crashes if the requested file is not present on the disk. Traditionally, programmers used the return values of methods to detect error that occurred at run time. Error handling becomes a necessity when developing applications that need to take care of unexpected situations. The unexpected situations that may occur during program execution are: Running out of memory Resource allocation errors Inability to find files Problems in the network connectivity Exception An exception is an event that occurs during the execution of a program that disrupts the normal flow of instructions during the execution of a program. Exception handling code can perform the following tasks. Find the problem(Hit the exception) Inform the error has occurred(Throw exception) Receive the error information(Catch the exception) Take corrective actions(Exception handling) Inside the standard package Java.lang, java defi...