Multiple choice technology programming languages

What is the output of following.

public static void main(String[]  args) {
    final int b=3;
    byte c=b/2;
    System.out.println("c="+c);
}

  1. Runtime Exception

  2. 1.5

  3. 1

  4. CompileTimeError

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

Integer division in Java truncates toward zero, so 3/2 equals 1 (not 1.5). The result is assigned to byte c. This compiles without error because the compiler knows 1 is within byte range (-128 to 127). The output is "c=1".