Question: I don't understand what is going on in this code in Java, comments within the code would help a bunch. Exceptions Activity public class ExceptionActivity
I don't understand what is going on in this code in Java, comments within the code would help a bunch. 
Exceptions Activity public class ExceptionActivity { public void doThis() { try! Scanner scanner = new Scanner(System.in); System.out.println("Enter two integers separated by space"); int x = scanner.nextInt(); int = scanner.nextInt(); int z = x/y; System.out.println(z); } catch (ArithmeticException e) { System.out.print("A"); 1 catch (RuntimeException e) { System.out.print(" "); 3 catch (Exception e) { System.out.print("C"); } finally System.out.println("D"); 1 1 public void doThis (int[] nums, int val) { try { for (int i = 0; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
