Question: Java Quiz due in 22 minutes. Need Help Please! Which statement is correct on the following segment of code, assuming the code is embedded in
Java Quiz due in 22 minutes. Need Help Please!

Which statement is correct on the following segment of code, assuming the code is embedded in a proper program? } catch (Exception e) { } catch (ArrayIndexoutofBoundsException be) { Should not have a catch (Exception) block. It's a bad programming style. Such a program will not compile. If an ArrayIndexOutOfBounds Exception object is thrown in the try block, this exception will be caught by catch (Arrayxxx). If an ArithmeticException object is thrown in the try block, the program will crash. Question 7 2 pts The best Exception class to use with this segment of code is: public class Test { public static void main(String[] args) { try { int zero = 0; int y = 2/zero; } catch (?) { System.out.println(e); IndexOutOfBoundsException ArithmeticException Number FormatException InputMismatchException
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
