Is 00 an integer or octal in Java?
问题 Is 00, 000, or 000... an integer in Java? Or is it an octal? If is it an octal is 001 or 0005 an octal? 回答1: 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. 回答2: Number literal representation