2) Consider the following code segment.
int a = 1;
int n = 0;
int result = a / n;
if (n == 0)
(
System.out.println("divide by zero"); // statement1
}
else
{
System.out. println(result); // statement2
}
Which of the following occur upon execution of the code segment?
(A) A syntax error
(B) statement1 is executed
(C) statement2 is executed
(D) Both statements are executed