大神指点一下
package com.lianxi;
import java.util.Arrays;
public class Biancheng {
public static void main(String[] args) {
Biancheng hello=new Biancheng();
int[] nums=hello.print(7);
Arrays.sort(nums);
System.out.println("考试成绩的前三名为:");
System.out.println(Arrays.toString(nums));
System.out.println(nums[6]);
System.out.println(nums[5]);
System.out.println(nums[4]);
}
public int[] print(int length) {
int[] scores={89,-23,64,91,119,52,73};
int[] nums=new int[length];
for(int i=0;i<scores.length;i++){
if(0<scores[i]&&scores[i]<100){
int j=0;
nums[j]=scores[i];
j++;
}
}
return nums;
}
}
哪里不对了?