這個錯誤怎么改
import java.util.Arrays;
public class HelloWorld {
? ??
? ? //完成 main 方法
? ? public static void main(String[] args) {
? ? ?HelloWorld hello=new HelloWorld();
? ? ?int[] scores ={89,-23,64,91,119,52,73};
? ? ?hello.score(scores);
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? }
? ??
? ? //定義方法完成成績排序并輸出前三名的功能
? ? public void score(int[] scores){
? ? ? ? Arrays.sort(scores);
? ? ? ? int num = 0;
? ? ? ? for(int i =scores.length-1;i>=0;i--){
? ? ? ? ? ? if(scores[i]>100||scores[i]<0);{
? ? ? ? ? ? continue;
? ? ? ? ? ? }
? ? ? ? ? ? num++;
? ? ? ? ? ? if(num>3){
? ? ? ? ? ? ?break;
? ? ? ? ? ? ?}
? ? ? ? ? ? System.out.println(scores[i]);
? ? ? ? }
? ? ? ??
? ? }
? ??
錯誤顯示是num++的問題
2016-04-11
score方法中第一個if后面多了一個分號
2016-04-11
我找到了 if()后面多加了;號
2016-04-11
看起來沒有問題啊 而且num也已經聲明了