我的代码:
public class SortTest
{
 public void Sort(int K[],int n)
 {
 int j,flag=1;
 int temp;
 int i=n-2;
 while(i>=0&&flag==1)
 {
 flag--;
 for(j=0;j<i;j++)
 {
 if(K[j]>K[j+1])
 temp=K[j];
 K[j]=K[j+1];
 K[j+1]=temp;
 flag++;
 }
 i--;
 }
 }
public static void main(String [] args)
{
int [] k=new int[100];
for(int y=0;y<100;y++)
{
k[y]=100-y;
}
SortTest stObj=new SortTest();
stObj.Sort(k[100],100);
for(int x=0;x<100;x++)
{
System.out.print(k[x]+" ");
}
}
}
编译显示:无法将SortTest中的Sort(int K[],int n)应用于(int,int)