提交代码出现Exception in thread "main" ..这样的问题,哪位大神可以来指导指导我。
import java.util.Arrays;
public class HelloWorld {
//完成 main 方法
public static void main(String[] args) {
HelloWorld hello=new HelloWorld();
int[] scores={89,-23,64,91,119,52,73};
hello.sort(scores);
}
//定义方法完成成绩排序并输出前三名的功能
public void sort(int[] scores){
Arrays.sort(scores);
for (int i=0 ; i<scores.length ; i++ ){
if (scores[i]<0 ||scores[i]>100 ){ //将小于0或者大于100的去除
scores[i]=0;
}
Arrays.sort(scores);
}
for (int j=scores.length ; j>4 ; j-- ){
System.out.println("考试成绩的前三名为:"+scores[j]);
}
}
}