【发布时间】:2016-03-25 06:24:27
【问题描述】:
这是我的代码
public class assertion {
public static void main(String[] args) {
int a=11,b=3,i=0;
double assert=2.4;
a+=a;
b+=b;
if(i!=0) {
System.out.println("hi");
} else {
assert a+b==11:"a+b=11";// stops the exe of the program
System.out.println(a+b);
}
}
}
在 "double assert=2.4;" 语句中,我收到 error 作为 “令牌“assert”的语法错误,VariableDeclarat 无效”。请帮帮我。
【问题讨论】: