Question: java question Which pair of the exceptions are the most appropriate to be used in the catch blocks of the following program? public class HelloWorld

 java question Which pair of the exceptions are the most appropriate

java question

Which pair of the exceptions are the most appropriate to be used in the catch blocks of the following program? public class HelloWorld { public static void main(String args[]) { Scanner in = new Scanner(System.in); try { int k = in.nextInt(); String s = "JAVAisnotfun"; System.out.println(s.charAt(k)); } catch ex) { } catch { ex) } finally { Select one: a.Input MismatchException and ClassCastException b.InputMismatchException and StringIndexOutOfBoundsException c. There is no risk of exception d.NullPointerException and StringIndexOutOfBoundsException e.ArithmeticException and ClassCastException

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!