提示我main中 showTop3错误,哪里错了?
import java.util.Arrays;
public class Java_8_1 {
public static void main(String[] args)
{
int[] scores = {89,-23,64,91,119,52,73};
System.out.println("考试成绩前三名为:");
Java_8_1 snoopy = new Java_8_1();
snoopy.showTop3=(scores);
}
public void showTop3(int[] scores)
{
Arrays.sort(scores);
int nums = 0;
for(int i= scores.length; i >= 0; i--)
{
if(scores[i]<0 || scores[i]>100)
{
continue;
}
nums++;
if(nums>3)
{
break;
}
System.out.println(scores[i]);
}
}
}