Multiple choice technology programming languages

public class Question { public static void main(String args[]) { int x=0x10; System.out.print("X="+x); } }

  1. X=10

  2. X=16

  3. X=0

  4. Compile Time Error

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

Java uses the 0x prefix for hexadecimal literals. The value 0x10 represents hexadecimal 10, which equals decimal 16 (1×16¹ + 0×16⁰), producing output X=16.