Multiple choice technology programming languages

byte b; final int a = 10; final int x = a; b = x; System.out.println("The value of b is " + b);

  1. Compilation error

  2. Runtime Error

  3. 10

  4. None of these

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

The code compiles and runs. Byte b is not explicitly initialized but gets value from final int x (which is compile-time constant 10). Since 10 fits in byte range (-128 to 127), the assignment is valid. Output is 10.