无法达成的陈述

Tro*_*roy 0 java loops

我有一个循环旨在验证一个问题的用户输入,它工作正常,直到我添加这个;

        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)

现在,每当我尝试编译时,我都会收到一条错误,指出这是一个无法访问的语句,导致这种情况的原因是什么?

Ste*_*n C 10

有一个虚假的';' 在您添加的代码的第一行,使第一行continue;始终执行!