实际上我的系统将Long.MAX_VALUE设为9223372036854775807
但是当我写这样的程序时,
package hex;
/**
*
* @author Ravi
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
long x = 9223372036854775807;
System.out.println(x);
}
}
Run Code Online (Sandbox Code Playgroud)
我收到编译时错误.任何人都可以解释原因吗?