限制int是从-2147483648到2147483647.
如果我输入
int i = 2147483648;
Run Code Online (Sandbox Code Playgroud)
那么Eclipse将在"2147483648"下面提示一个红色下划线.
但如果我这样做:
int i = 1024 * 1024 * 1024 * 1024;
Run Code Online (Sandbox Code Playgroud)
它会编译好.
public class Test {
public static void main(String[] args) {
int i = 2147483648; // error
int j = 1024 * 1024 * 1024 * 1024; // no error
}
}
Run Code Online (Sandbox Code Playgroud)
也许这是Java中的一个基本问题,但我不知道为什么第二个变量不会产生错误.
我正在开发一个基于J2EE EJB JSF的项目,数据库是MYsql,该项目上周运行良好.但是今天,当我运行它时它无法部署.这里有一些例外:
Initial deploying ECOM to C:\Users\John624\Documents\NetBeansProjects\PromoCoupon\ECOM\dist\gfdeploy\ECOM
Completed initial distribution of ECOM
Initializing...
invalid header field name: Exception Description
C:\Users\John624\Documents\NetBeansProjects\PromoCoupon\ECOM\nbproject\build-impl.xml:307: The module has not been deployed.
See the server log for details.
BUILD FAILED (total time: 5 seconds)
Run Code Online (Sandbox Code Playgroud)
Glassfish的:
<code> SEVERE: Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method
SEVERE: Exception while invoking class org.glassfish.javaee.full.deployment.EarDeployer prepare method
SEVERE: org.glassfish.deployment.common.DeploymentException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [ECOM-ejbPU] failed.
Internal Exception: Exception [EclipseLink-7158] (Eclipse Persistence …Run Code Online (Sandbox Code Playgroud) 昨天,Eclipse 开始显示“未使用的导入错误”,而实际上所有导入都是必需的。如果我删除了据称未使用的导入,Eclipse 会提示我再次添加它!
顺便说一句,我可以毫无问题地执行我的程序。我该如何解决这个问题?