Engineering Full Stack Apps with Java and JavaScript
Given:
public class ExceptionCheck { static int i = 10; public static void main (String[] argds) { System.out.println(myMethod()); System.out.println(i); } public static int myMethod() { try{ throw new Exception(); } catch(Exception e) { return i; } finally{ i = 12; return i; } } }
Select 1 option
A. Compilation Fail
B. Print 10 and 12.
C. Print 10 and 10.
D. Print 12 and 12.