Multiple choice technology programming languages

package exceptions; public class TestException1 { static double testException(int x, int y) { return (x/y); } public static void main(String[] args) { try { double p = testException(10,0); System.out.println("p = "+p); System.out.println("Division done"); } catch(Exception e) { System.out.println("Exception happened "+e.getMessage()); } finally { System.out.println("In finally"); } } }

  1. Exception happened / by zero In finally

  2. Exception happened / by zero

  3. In finally

  4. Compiler Error

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Division by zero throws ArithmeticException with message '/ by zero'. The catch block prints 'Exception happened / by zero'. Control then proceeds to the finally block, which prints 'In finally'. Both statements execute in sequence.