請問我的main函數(shù)里的提示語句哪里錯了
package program;
import java.util.Arrays;
public class HelloWorld {
?? ?
?? ?public static void main(String[] args) {
?? ??? ?int scores[]={89,-23,64,91,119,52,73};
?? ??? ?HelloWorld target = new HelloWorld();
?? ??? ?System.out.println("考試成績的前三名為:"+ArrayType.toString(target.sort(scores)));
?? ?}
?? ?
?? ?public void sort(int []scores){
?? ??? ?Arrays.sort(scores);
?? ??? ?int count =0;
?? ??? ?for(int i = scores.length;i>=0;i--){
?? ??? ??? ?while(count<3){
?? ??? ??? ??? ?if(scores[i]>=0 || scores[i]<=100){
?? ??? ??? ??? ??? ?continue;
?? ??? ??? ??? ?}
?? ??? ??? ??? ?System.out.println(scores[i]);
?? ??? ??? ??? ?count+=1;
?? ??? ??? ?}
?? ??? ?}
?? ?}
?? ??? ?
}
2017-06-20
package program;
import java.util.Arrays;
public class HelloWorld {
?? ?
?? ?public static void main(String[] args) {
?? ??? ?int scores[]={89,-23,64,91,119,52,73};
?? ??? ?HelloWorld target = new HelloWorld();
?? ?????System.out.println("考試成績的前三名為:"+ArrayType.toString(target.sort(scores)));
? ? ? ??target.sort(scores);? ?//這里少了一這樣一句,否則scores[]的值將無法傳遞
? ? }
? ?
?? ?public void sort(int []scores){
?? ??? ?Arrays.sort(scores);
?? ??? ?int count =0;
?? ??? ?for(int i = scores.length;i>=0;i--){
?? ??? ??? ?while(count<3){
?? ??? ??? ??? ?if(scores[i]>=0 || scores[i]<=100){
?? ??? ??? ??? ??? ?continue;
?? ??? ??? ??? ?}
?? ??? ??? ??? ?System.out.println(scores[i]);
?? ??? ??? ??? ?count+=1;
?? ??? ??? ?}
?? ??? ?}
?? ?}
}
2017-06-13
沒有進(jìn)行方法調(diào)用,參數(shù)無法傳遞