系统提示i cannot be resolved to a variable的错误,但我打出来的程序跟答案一样啊
package mukewang;
import java.util.Arrays;
public class HelloWorld {
public static void main(String[] args) {
int[] scores = {89,-23,64,91,779,52,73};
System.out.println("本次考试成绩前三名为:");
HelloWorld hello = new HelloWorld
hello.showA(scores);
}
//定义方法完成成绩排序并输出前三名的功能
public void showA(int[] scores){
Arrays.sort(scores);
int num = 0;
for(int i = scores.length-1;i >= 0 && num < 3;i--);
if (scores[i] > 100 || scores[i] < 0){
continue;
}
num++;
if(num > 3){
break;
}
System.out.println(scores[i]);
}
}
();