帮我看一下。。。
public class HelloWorld {
//完成 main 方法
public static void main(String[] args) {
int[] scores={89,-23,64,91,119,52,73};
System.out.println("考试成绩的前三名为");
Helloword hello=new Helloworld();
hello.showTop3(scores);
}
//定义方法完成成绩排序并输出前三名的功能
public void showTop3(int[] scores){
Arrays.sort(scores);
int m=0;
for(int i=0;i<scores.length;i++){
if(scores[i]<0||scores[i]>100){
continue;
}
m++;
if(m>=3){
break;
}
System.out.println(scores[i]);
}
}
}
为什么要定义hello而不是scores,它的用处是什么Helloword hello=new Helloworld()?
代码运行为什么会出错