为什么给数组赋值会失败,只赋入一个52
public static void main(String[] args) {
int[] scores = new int[]{89,-23,64,91,119,52,73};
Arrays.sort(scores);
System.out.println(Arrays.toString(scores));
Number numThree= new Number();
int[] num_3=numThree.score(scores);
System.out.println(num_3[0]);
System.out.println(num_3[1]);
System.out.println(num_3[2]);
}
public int[] score(int[] scores){
int[] s=new int[3];
for(int i =scores.length-1;i>=0;i--){
if(scores[i]>100||scores[i]<0){
continue;
}
int j=0;
s[j]=scores[i];
j++;
if(j==3){
break;
}
}
System.out.println("考试成绩的前三名为:"+Arrays.toString(s));
return s;
}