package javaapplication10; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; public class JavaApplication10 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int i,j,k; while(true) { System.out.println("1. Checked Exception"); System.out.println("2. ArithmeticException"); System.out.println("Enter Choice:"); int choice = sc.nextInt(); switch(choice) { case 1: System.out.println("Checked exception..."); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); **40; try { System.out.println("Enter a number"); j = Integer.parseInt(br.readLine()); k=i/j; System.out.println("Output is:"+k); } catch(IOException e) { System.out.println("Some IO Error"); } break; case 2: System.out.println("ArithmeticException with finally block....."); try { **7; j=1; k=i/j; System.out.println("output is \n"+k); System.out.println("Bye in try Block"); } catch(ArithmeticException e) { System.err.println("Error \n"); System.out.println("Bye in Catch Block"); } finally { System.out.println("Bye in finally Block"); } break; case 3: return; } } } }