Question: Select all possible exceptions that might occur when running this code: int[] array = new int[2]; Scanner input = new Scanner(System.in); array[0] = input.nextInt(); array[1]

Select all possible exceptions that might occur when running this code:

int[] array = new int[2];

Scanner input = new Scanner(System.in);

array[0] = input.nextInt();

array[1] = input.nextInt();

System.out.println(array[0]/array[1]);


ArrayIndexOutOfBoundsException

FileNotFoundException

InputMismatchException

ArithmeticException

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!