Java编译错误 - 继续不能在循环外使用

Res*_*ACK 1 java loops

Eclipse Java IDE在使用continue语句时遇到问题时出错:

    double sum = 0.0;  
    double avg = 0.0;
    for (i=0 ; i<daRun1.length ; i++);
    {
        if(daRun1[i] == max || daRun1[i] == min)
            {
            continue; //<-- **this is where the error is showing (underlined in red in eclipse)**
            }
        sum += daRun1[i];
    }
    avg = sum / (daRun1.length-2);

    System.out.println("The average score is: " + avg);
Run Code Online (Sandbox Code Playgroud)

我的代码出了什么问题?这个确切的if循环用于演示,没有任何问题.

dry*_*hip 8

问题是continue不在for循环中.

你用这里的分号结束循环:

for (i=0 ; i<daRun1.length ; i++);
Run Code Online (Sandbox Code Playgroud)

取出分叉,它应该工作正常.