<分区>
Possible Duplicate:
09 is not recognized where as 9 is recognized
只是想知道,当我声明以下内容时:
public static final long __VERSIONCODE = 0L;
public static final long __VERSIONCODE = 9L;
那会起作用,但每当我尝试这个时:
public static final long __VERSIONCODE = 09L;
public static final long __VERSIONCODE = 08235L;
我得到一个错误(在 eclipse 中):
"The literal 09L of type long is out of range."
所以我认为那是因为它以零开头。
但后来我尝试将第二个数字降低为八:
public static final long __VERSIONCODE = 07235L;
这没有给我错误。
然后:
public static final long __VERSIONCODE = 07239L;
也给我一个错误。
所以我真的不明白我可以为 long 分配哪些值,哪些不能。为什么会出现此错误? (实际上只是我很好奇,我也可以只使用 String 作为我的版本代码)。
此外,我忘了提到使用 double 而不是长整型的行为完全相同。