try catch - Java Quiz Question


In which order will the lines appear in the output of this program? Or does it not compile?

public class SecondException
{
    public static void main(String args[])
    {
        try
        {
            int i = 21 / 0;
            System.out.println(i);
        }
        catch (NullPointerException e)
        {
            System.out.println(e);
        }
        
        System.out.println("Rest of the code......");
    }
}


A
java.lang.ArithmeticException: / by zero
B
java.lang.ArithmeticException: / by zero
Rest of the code......
C
0
Rest of the code......
D
Compilation Error for some other reason