java - 00在Java中是整数还是八进制?

标签 java integer octal

00, 000, or 000...

Java 中的整数? 还是八进制?如果是八进制是

001 or 0005

八进制?

最佳答案

都是整数,但是...

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

来自 Java Language Specification (强调我的):

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.

关于java - 00在Java中是整数还是八进制?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24031843/

相关文章:

关于文件格式和od的C++问题

c - 从C中的八进制数中提取数字

java - apache poi 与 python xlrd

java - 验证页码/打印范围

java - 在Java中查找一个月中的天数

java - 使用 .getDeclaredMethod 从扩展另一个类的类中获取方法

C - 将 3.00 变为 3

java - Java 中的大数

c - 在c中将 float 除以整数时得到整数结果

c - "C: A reference manual"这本书中关于整数常量