我有一个循环旨在验证一个问题的用户输入,它工作正常,直到我添加这个;
if (userInput.charAt(0) > NUMCOLS && userInput.charAt(0) < 0);
{
System.out.println("Error, " + userInput + " is an invalid move.");
continue;
}
Run Code Online (Sandbox Code Playgroud)
在这之前
if (userInput.charAt(2) !='-')
{
System.out.println("Error, " + userInput + " is an invalid move.");
continue;
}
Run Code Online (Sandbox Code Playgroud)
现在,每当我尝试编译时,我都会收到一条错误,指出这是一个无法访问的语句,导致这种情况的原因是什么?
归档时间: |
|
查看次数: |
7494 次 |
最近记录: |