Multiple choice general knowledge history

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

  1. X=10

  2. X=0

  3. X=16

  4. Compile Time Error

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

In Java, hexadecimal literals begin with 0x. The value 0x10 in hexadecimal equals decimal 16 (1 × 16^1 + 0 × 16^0 = 16). The prefix indicates number system, not value.