Multiple choice technology programming languages

In which all cases does an exception gets generated. Select the two correct answers. int i = 0, j = 1;

  1. if((i == 0) || (j/i == 1))

  2. if((i == 0) | (j/i == 1))

  3. if((i != 0) && (j/i == 1))

  4. if((i != 0) & (j/i == 1))

Reveal answer Fill a bubble to check yourself
B,D Correct answer
Explanation

The single bitwise operators | and & do not perform short-circuit evaluation. Therefore, even if the first operand determines the outcome, the second operand (j/i == 1) is evaluated, causing an ArithmeticException (division by zero) because i is 0.