目前刚接触java,现在我正在做一个涉及if else语句的作业。有人可以为什么javac
正在读我的其他东西晃来晃去?我的语法应该是正确的,除非我在这里遗漏了一些东西。
答案 0 :(得分:6)
你必须在if语句后删除你的分号。否则if后面的大括号不会被执行。
我希望这能解决你的问题。
if(Statement);
{
//The Content would not be executed in realtion to the if-statemen
}
否则:
if(Statement)
{
//The Content would be executed in realtion to the if-statemen
}
答案 1 :(得分:1)
删除if语句后面的分号(;)
答案 2 :(得分:0)
你的if后面有一个分号。删除它。
答案 3 :(得分:0)
您必须删除以databaseIndex
开头的行尾的;
。
答案 4 :(得分:0)
改变:
if(...);
{
////
}
到
if(...)
{
////
}