Java – Introduction to Exceptions
Introduction: While Compiling and Executing Java application, chance of getting 3 types of errors. InputMismatchException: It occurs if user enter invalid input while reading through Scanner. import java.util.Scanner;class Code{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println(“Enter 2 numbers : “); int a = sc.nextInt(); int b = sc.nextInt(); int c …