Review the code below. public class MyException extends Exception { MyException (int val) { super (val + } public class
Posted: Sat Jul 09, 2022 11:48 am
Review the code below. public class MyException extends Exception { MyException (int val) { super (val + } public class AnotherQuestion { public static void foo(int x) throws MyException, IllegalArgumentException { if (x < 0) { } if (x > 100) { } low 1 ОК System.out.println("low"); throw (new MyException (x)); is too low"); System.out.println("Bunny"); } public static void main(String[] args) { int x = -1; try { System.out.println("high"); } throw (new IllegalArgumentException ("YellowJacket")); True foo (x); } catch (IllegalArgumentException e) { System.out.println("2"); False } catch (MyException e) { System.out.println("Bug"); } finally ( System.out.println("1"); The output of the code is: System.out.println("OK");