Finally keyword - Java Quiz Question


What will be the output of the following program?

public class FinallyDemo {
    FinallyDemo(int x, int y) {
        try {
            System.out.println("Division result is " + x / y);
        } catch (ArithmeticException ae) {
            System.out.println("Cannot divide by zero");
        } finally {
            System.out.println("Finally Executed");
        }
    }
    public static void main(String[] arg) {
        new FinallyDemo(10, 0);
    }
}


A
Cannot divide by zero
Finally Executed
B
Division result is 0
Finally Executed
C
Cannot divide by zero
D
Finally Executed