//#冒泡排序
public class BubbleSortMethod {
public static void main(String[] args){
//需要排序的列表值
int[] myList = {10,50,30,56,45,89,75,7};
for(int i=0;i<myList.length-1;i++){
for(int j = 0; j<myList.length-1-i;j++){
if(myList[j]>myList[j+1]){
int a = myList[j];
myList[j]=myList[j+1];
myList[j+1]=a;
}
}
}
//打印出排序结果
for (int element: myList) {
System.out.print(element+", ");
}
}
}