why output so strange 0022 =18? hello everyone to day i have test.the question is "what is the output of
System.out.println(0022);
i so confuse why Answer is 18
explain needed
why output so strange 0022 =18? hello everyone to day i have test.the question is "what is the output of
System.out.println(0022);
i so confuse why Answer is 18
explain needed
If the first digit of an int
literal is 0
, Java interprets the number in octal (base 8).