import java.util.Arrays;
public class HelloWorld {
//完成 main 方法
public static void main(String[] args) {
HelloWorld show=new HelloWorld();
show.hello();
}
//定义方法完成成绩排序并输出前三名的功能
public int hello(){
int[] scores={89,-23,64,91,119,52,73};
int[] newScores=new int[3];
int count=0;
for(int i=0;i<scores.length;i++){
if(scores[i]>=0&&scores[i]<=100){
for(int j=i;j<=i;j++){
newScores[j]=scores[i];
conunt++;}
if(count>=3){break;}
}
System.out.println(Arrays.sort(newScores)) ;
}
}
错误1:int count=0; counut++;应改为count++;
错误2:public int hello(){}应该有返回值,return 0;
错误3:System.out.println()打印应该有值,Arrays.sort(newScores)无返回值