UNit-3 : Exception Handling
An exception is a runtime error, which will distrupts the normal flow of application. Checked exceptions checked exception is an exception that occurs at the compile time, these are also called as compile time exceptions. 1. ClassNotFoundException : This exception is thrown when the JVM tries to load a class, which is not present in the classpath. Class.forName("oracle.jdbc.driver.OracleDriver"); 2. FileNotFoundException : This exception is thrown when the program tries to access a file that does not exist or does not open. This error occurs mainly in file handling programs. File file = new File("E:// file.txt"); FileReader fr = new FileReader(file); 3. IOException : This exception is thrown when the input-output operation in a program fails or is interrupted during the program’s execution. 4. InterruptedException : This exception occurs whenever a thread is processing, sleeping or waiting in a multithreading program and it is interrup...