以下代码未在 Java 中编译:
java version "1.6.0_24" OpenJDK Runtime Environment (IcedTea6 1.11.1) (suse-3.1-x86_64) OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
public class XOR
{
public static void main(String[] args)
{
long one = 595082963178094600000L;
}
}
这会引发错误:
XOR.java:5: integer number too large: 595082963178094600000
但我已经正确地指出它很长!以下也会引发错误:
public class XOR
{
public static void main(String[] args)
{
long one = new Long( "595082963178094600000" );
}
}
这抛出:
java.lang.NumberFormatException: For input string: "595082963178094600000"
我究竟做错了什么?