為什么不能運行那?
package ch01;
public class ScoresSort {
public static void main(String[] args) {
// TODO Auto-generated method stub
/*
?* 要求:
?* 1、 考試成績已保存在數(shù)組 scores 中,數(shù)組元素依次為 89 , -23 , 64 , 91 , 119 , 52 , 73
?* 2、 要求通過自定義方法來實現(xiàn)成績排名并輸出操作,將成績數(shù)組作為參數(shù)傳入
?* 3、 要求判斷成績的有效性( 0—100 ),如果成績無效,則忽略此成績
?*/
int[] scores={ 89 , -23 , 64 , 91 , 119 , 52 , 73};
ScoresSort sort=new ScoresSort();
sort.getSort(scores);
}
void getSort(int[] a){
int i,del;
for(i=0;i<a.length;i++){
if(a[i]<0||a[i]>100)?
del=i;
}
i=0;
? while(i>del){
? a[i-1]=a[i];
? i++;
? }
? for(int j=0;j<a.length;j++)
? System.out.println(a[j]);
? ?
}
}
2016-07-23
方法定義的不對 ?public呢 ?