这可能是愚蠢的。但是,我收到一条错误消息:“error:';'尝试构建以下代码时,预期的If(!Temp_List.isEmpty())“。我不知道。有人可以帮忙解决这个问题吗?
提前致谢 !
public class Error_Case
{
ArrayList<String> Temp_List=new ArrayList<String>();
private class CHECK_CLASS
{
public void Check()
{
If(!Temp_List.isEmpty())
{
System.out.println("Temp_List is not empty !");
}
}
}
public void run()
{
CHECK_CLASS new_Class=new CHECK_CLASS();
new_Class.Check();
}
public static void main (String[] args)
{
Error_Case controller=new Error_Case();
controller.run();
}
}
最佳答案
所有Java关键字均为小写。因此,If
应该是if
:
if (!Temp_List.isEmpty())
{
System.out.println("Temp_List is not empty !");
}
关于java - 错误: ';' expected,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26942083/