Question: Select all possible exceptions that might occur when running this code: int[] array = new int[5]; Scanner input = new Scanner(System.in); int num1 = input.nextInt();
Select all possible exceptions that might occur when running this code:
int[] array = new int[5];
Scanner input = new Scanner(System.in);
int num1 = input.nextInt();
System.out.println(array[num1]);
ArrayIndexOutOfBoundsException | ||
ArithmeticException | ||
FileNotFoundException | ||
InputMismatchException |
ect all possible exceptions that might occur when running this code: into array - new int[5); Scanner input = new Scanner(System.in): int num1 - input.nextInt(); System.out.println(array(num1]); OutOfBoundsException Exception ndException tchException
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
