你的数组越界了,public class test2{
public static void main (String [] args){
int arrayOflnts[]={32,87,3,589,12,1076,2000,8,622,127};
for (int i=arrayOflnts.length;--i>=0;){
for(int j=0;j<10-i;j++){ //应该为for(int j=0;j<10-i-1;j++)
if (arrayOflnts[j]>arrayOflnts[j+1]){
int temp=arrayOflnts[j];
arrayOflnts[j]=arrayOflnts[j+1];
arrayOflnts[j+1]=temp;
}
}
}
for(int i=0;i<arrayOflnts.length;i++){
System.out.println(arrayOflnts[i]+"");
}
System.out.println();
}
}
[shadow=255,red,2]待到秋来九月八,我花开时百花杀。冲天香阵透长安,满城尽是黄金甲。 [/shadow]