package com.imooc;
import java.util.Arrays;
public class HelloWorld {
public static void maid(String[]args){
int [] scores={21,-23,56,192,23,102,62,72};
System.out.println("前三名");
HelloWorld hello=new HelloWorld();
hello.getTop3(scores);
}
public void getTop3(int[]scores){
Arrays.sort(scores);
}
}
import java.util.Arrays;
public class HelloWorld {
public static void main(String[]args){
int [] scores={21,-23,56,192,23,102,62,72};
System.out.println("前三名:");
HelloWorld hello=new HelloWorld();
hello.getTop3(scores);
}
public void getTop3(int[]scores){
Arrays.sort(scores);
for(int i=scores.length-1;i>scores.length-4;i--){
System.out.print(scores[i]+" ");
}
}
}
第四行main方法名错了,你写成maid了