在定義方法是eclipse報錯
package score;
import java.util.Arrays;
public class chengji {
public static void main(String[] args) {
? ? ? ? int[] scores={89,-23,64,91,119,52,52,73};
? ? ? ? chengji hello=new chengji();
? ? ? ? hello.a(scores);
? ? ? ??
? ? ? ? public static void a(int[] scores)
? ? ? ? Arrays.sort(scores);
? ?int num=0;
? ?for(int i=scores.length-1;i>=0;i--){
? ? if(scores[i]<0&&scores[i]>100)
? ? {
? ? continue;
? ? }
? ? if(num>3)
? ? {break;}
? ? ? ?System.out.println(scores[i]);
? ?}
? ?
}
}
2016-07-08
你在hello.a(scores);
后面加個大括號把main函數(shù)括起來 ?‘}’