public class ArrayParameter {
public void paixu(int b[]){
int temp;
for(int i=0;i<b.length-1;i++){
for(int j=0;j<b.length-i-1;j++){
if(b[j]>b[j+1]){
temp = b[j];
b[j]=b[j+1];
b[j+1]=temp;
}
}
}
}
public static void main(String[] args) {
int a[] = {3,8,5,0,7,2};
System.out.println("排序之前的数据为:");
for(int temp: a){
System.out.print(" " + temp);
}
System.out.println();
System.out.println("排序之后的数据为:");
ArrayParameter m = new ArrayParameter();
m.paixu(a);
for(int temp : a)
System.out.print(" " + temp);
}
}