排序异常
大大帮我看看这个程序怎么了!排数字的题目要用到异常吗??
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++){
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();
}
}