EXCEPTION HANDLING =================== ==> There are three types of errors: 1) Syntax Errors 2) Run-time Errors 3) Logical Errors 1) Syntax Errors: ================= ==> occurred because of mistake in syntax. Ex: java program class Greetings{ public static void main(String[] args) { System.out.println("Hello World!"); } } ==> Syntax Error should always identified by the compiler. 2) Run time error: ================== based on the type of input, the system can get crashed (unexpectedly stopped). this input can be detected during the run time of the program and this interruption is called as "Run time Error" also called as an "Exception". ==> Run time errors or exceptions can be detected by JVM. package package3; import java.util.Scanner; public class TestClass { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a,b,c; System.out.println("Enter values:"); a = sc.nextInt(); b = sc.nextInt(); c = a/b; System.out.println(c); } } 3) Logical Error: ================= CanaraBankServices{ deposit(){ balance *= amount; } withdraw(){ balance -= amount; } } ============================================================= Why Exception Handling? ======================= To run the application normally even in the abnormal conditions we can use the exception handling. What happens when an exception occurs? ======================================= At JRE: 1) print the exception stack trace 2) terminate the program/application.