兄弟们看下我的代码用无参无返回值做出来的但是却是四个值 找了好几遍也找不到 万分感谢
package First;
import java.util.Arrays;
public class HelloWorld {
public static void main(String[] args) {
System.out.println("考试成绩前三名:");
HelloWorld hello=new HelloWorld();
hello.getArrays();
}
public void getArrays() {
int j=1;
int [] nums={89,-23,64,91,119,52,73};
Arrays.sort(nums);
for (int i=nums.length-1; i>=0; i--){
if (nums[i]>=0 && nums[i]<=100){
j++;
if(j>3){
break;
}
}
System.out.println(nums[i]);
}
}
}