Is 00 an integer or octal in Java?

All are integers, but…

1  is decimal
0  is decimal
01 is octal
00 is octal

From Java Language Specification (emphasis mine):

Note that octal numerals always consist of two or more digits; 0 is always considered to be a decimal numeral – not that it matters much in practice, for the numerals 0, 00, and 0x0 all represent exactly the same integer value.

Leave a Comment