不知道哪里錯了
import java.util.Arrays;?
public class HelloWorld {
? ?
? ? //完成 main 方法
? ? public static void main(String[] args) {
? ??
? ? HelloWorld show=new HelloWorld();
? ? show.hello();
? ? }
? ??
? ? //定義方法完成成績排序并輸出前三名的功能
? ??
? ? public int hello(){
? ? int[] scores={89,-23,64,91,119,52,73};
? ? int[] newScores=new int[3];
? ? int count=0;
? ? for(int i=0;i<scores.length;i++){
? ? if(scores[i]>=0&&scores[i]<=100){
? ? for(int j=i;j<=i;j++){
? ? ? ? ? ? newScores[j]=scores[i];
? ? ? ? ? ? conunt++;}
? ? if(count>=3){break;}
? ? ? ? }
? ? System.out.println(Arrays.sort(newScores)) ; ?
? ? }?
? ??
? ? }
2015-08-31
錯誤1:int count=0; counut++;應(yīng)改為count++;
錯誤2:public int hello(){}應(yīng)該有返回值,return 0;
錯誤3:System.out.println()打印應(yīng)該有值,Arrays.sort(newScores)無返回值