注释行里的代码
public class HelloWorld {
public static void main(String[] args) {
int age=25;
/**
if((age>=18)==1)
{
System.out.println("成年");
}
else{
System.out.println("未成年");
}
*/
if(age>=18)
{
System.out.println("成年");
}
else{
System.out.println("未成年");
}
}
}
注释掉的代码为什么不可以
提交代码后提示下边提示“做的漂亮...”
右边运行结果提示
“error: incomparable types: boolean and int
if((age>=18)==1)
^
1 error
”